Guest User

-another byte

a guest
Apr 12th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def c(t):
  2.  v=0
  3.  for a in t:
  4.   if a==';':v+=1
  5.   if a=='}':v*=4
  6.  print v
  7. def i(t):
  8.  v,b=int(t),""
  9.  f="{}"if v<4 else""
  10.  while 1:
  11.   r,v=v%4,int(v/4)
  12.   if r>0:b=';'*r+b
  13.   if v>0:f=f+'{';b='}'+b
  14.   if v<4:b=';'*v+b;break
  15.  print f+b
  16. t=raw_input()
  17. try:int(t);i(t)
  18. except:c(t)
Advertisement
Add Comment
Please, Sign In to add comment