Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def c(t):
- v=0
- for a in t:
- if a==';':v+=1
- if a=='}':v*=4
- print v
- def i(t):
- v,b=int(t),""
- f="{}"if v<4 else""
- while 1:
- r,v=v%4,int(v/4)
- if r>0:b=';'*r+b
- if v>0:f=f+'{';b='}'+b
- if v<4:b=';'*v+b;break
- print f+b
- t=raw_input()
- try:int(t);i(t)
- except:c(t)
Advertisement
Add Comment
Please, Sign In to add comment