参考代码:
estimate = [int(input()) for i in range(12)] #预算 amount = 0 #零花钱 bank = [] flag = True for i in range(len(estimate)): amount += 300 - estimate[i] if amount < 0: print(-i - 1) flag = False break elif amount >= 100: bank.append(int(str(amount)[0]) * 100) amount -= int(str(amount)[0]) * 100 if flag: print(int(sum(bank) + sum(bank) * 0.2 + amount))
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:695 |
WU-格式化数据输出 (C++代码)浏览:1312 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:600 |
字符逆序 (C语言代码)浏览:706 |
C语言训练-数字母 (C语言代码)浏览:648 |
printf基础练习2 (C语言代码)浏览:653 |
矩形面积交 (C++代码)浏览:1204 |
图形输出 (C语言代码)浏览:1422 |
Hello, world! (C语言代码)浏览:916 |
Quadratic Equation (C语言代码)浏览:1034 |