???

bcm18 2021-08-31 21:17:03 4

n = int(input()) print(n) while True: if n>=100: a = n//100 print(a,'100yuan') n-=100a elif n<100: print('0 100yuan') if n>=50: a = n//50 print(a,'50yuan') n-=50a elif n<50: print('0 50yuan') if n>=20: a = n//20 print(a,'20yuan') n-=20a elif n<20: print('0 20yuan') if n>=10: a = n//10 print(a,'10yuan') n-=10a elif n<10: print('0 10yuan') if n>=5: a = n//5 print(a,'5yuan') n-=5*a elif n<5: print('0 5yuan') if n>=1: a = n//1 print(a,'1yuan') break

{{ vote && vote.total.up }}

共 3 条回复

bcm18

嗯!

root 站长

试试

root 站长

都用 if,不要用 elif