728x90
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | T = int(input()) for tc in range(1,T+1): N = int(input()) money = N f_c=0 t_c=0 fd_c=0 td_c=0 fh_c=0 oh_c=0 fy_c=0 tn_c=0 #print(money) if money >= 50000: f_c = money//50000 money = money-50000*f_c #print(f_c) if money >= 10000: t_c = money//10000 money= money-10000*t_c #print(money) if money >= 5000: fd_c = money//5000 money= money-5000*fd_c if money >= 1000: td_c = money//1000 money= money-1000*td_c if money >= 500: fh_c = money//500 money= money-500*fh_c if money >= 100: oh_c = money//100 money= money-100*oh_c if money >= 50: fy_c = money//50 money= money-50*fy_c if money >= 10: tn_c = money//10 money= money-10*tn_c #print(f_c) print("#{}".format(tc)) print("{} {} {} {} {} {} {} {}".format( f_c, t_c, fd_c, td_c, fh_c, oh_c, fy_c, tn_c )) | cs |
728x90