提交时间:2024-09-27 15:10:31
运行 ID: 52030
#include<bits/stdc++.h> using namespace std; int main() { int cost, money = 0, month = 1, momsmoney = 0; for(int i=1;i<=12;i++){ cin>>cost; money += 300; momsmoney += (money - cost)/100*100; money -= (money - cost)/100*100; money -= cost; if(money < 0){ cout<<-month; return 0; } month += 1;//下一个月开始 } cout<<money+momsmoney/5*6; return 0; }