- 问答
津津的储蓄计划 求大能思路
- 2024-11-24 20:17:35 @
求学长 老师指导
1 comments
-
圆周率循环 LV 4 @ 2024-11-25 13:20:50
#include <bits/stdc++.h> using namespace std;
int main() { int total = 0, remain = 0; for (int i = 1; i <= 12; i ++ ) { int cur; cin >> cur; if (remain + 300 < cur) { total = -i; break; } remain += 300 - cur; total += remain / 100 * 120; remain %= 100; } if (total >= 0) total += remain; cout << total << endl; return 0; }
- 1