求大佬指正

P1089 [NOIP2004 提高组] 津津的储蓄计划

懒得看你的 AC代码如下```cpp #include<iostream> using namespace std; int money,cost,mama,flag=1,monthofdeath; int main () { for(int i=1;i<=12;i++) { money+=300; cin>>cost; money-=cost; if(money<0) { flag=0; monthofdeath=i; break; } mama+=money/100; money%=100; } if(flag==1) { money+=mama*120; cout<<money; } else { cout<<-monthofdeath; } return 0; } ```
by kangzhibo @ 2023-12-24 14:23:57


|