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)
-
This problem is quite easy. Look carefully that if we square root s and take it ceil n, then the abscissa or the ordinate will be equal to ...
-
#include<iostream> #include<cstdio> #include<stack> #include<queue> #include<cstring> using namespace st...
-
/*** Md. Nazmul Hasan Shahjalal University of Science & Technology,Sylhet. hasan08sust@gmail.com ***/ #include<iostream> #include...
No comments:
Post a Comment