from sys import stdin scan = lambda : stdin.readline() test = int(scan()) for case in range(1,test+1): text = scan() counter =0 print("Case %d: "%case,end='') for i in range(0,len(text)): if text[i]>='A' and text[i]<='Z': txt = text[i] elif text[i]>='0' and text[i]<='9': counter = (counter*10) + int(text[i]) if i == len(text)-1 or (text[i+1]>='A' and text[i+1]<='Z'): for k in range(1,counter+1): print(txt,end='') counter =0 print()
21 December 2017
UVA 11541 Python solution
Subscribe to:
Post Comments (Atom)
-
/*** Md. Nazmul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<iostream> #i...
-
n = 1 while n: str = input () # print('Case no# %d :'%n) if str == ' * ' : break if str == ' Hajj ...
-
/*** Md. Namzul Hasan Shahjalal University of Science & technology,sylhet. hasan08sust@gmail.com ***/ #include<bits/stdc++.h...
No comments:
Post a Comment