求学长 老师指导

1 comments

  • @ 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