题解A109.津津的储蓄计划
2025-07-27 20:07:53
发布于:上海
0阅读
0回复
0点赞
#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+=mama120;
cout<<money;
}
else
{
cout<<-monthofdeath;
}
return 0;
}*
这里空空如也
有帮助,赞一个