arten_1337

Untitled

Sep 6th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. n = int(input())
  2. l = []
  3. for i in range(n):
  4.     y = int(input())
  5.     count = 0
  6.     while y:
  7.         if y >= 100:
  8.             count = count+y//100
  9.             y = y % 100
  10.         elif y >= 50:
  11.             count = count+y//50
  12.             y = y % 50
  13.         elif y >= 10:
  14.             count = count+y//10
  15.             y = y % 10
  16.         elif y >= 5:
  17.             count = count+y//5
  18.             y = y % 5
  19.         elif y >= 2:
  20.             count = count+y//2
  21.             y = y % 2
  22.         elif y >= 1:
  23.             count = count+y//1
  24.             y = y % 1
  25.         l.append(count)
  26. for i in l:
  27.     print(i)
Advertisement
Add Comment
Please, Sign In to add comment