Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. with open("in.txt", 'r') as inf:
  2.     s = inf.readline().strip()
  3.  
  4. result = ''
  5. count = 0
  6. while count < len(s):
  7.     lin_c = s[count]
  8.     lin_n = s[1 + count]
  9.     for j in range(2 + count, len(s)):
  10.         if s[j] < 'A':
  11.             lin_n += s[j]
  12.         else:
  13.             result += lin_c * int(lin_n)
  14.             count += len(lin_c) + len(lin_n)
  15.             break
  16.  
  17. with open("out.txt", 'w+') as ouf:
  18.     ouf.write(str(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement