提交时间:2024-02-20 19:37:59
运行 ID: 41381
#include <bits/stdc++.h> using namespace std; int main() { int sum = 0; int ans = 0; for(int i = 1; i <= 12; i++) { sum = sum + 300; int x; cin >> x; sum -= x; if(sum < 0) { cout << -i; return 0; } else { int bai = sum / 100 * 100; ans += bai; sum = sum - bai; } } cout << ans; }