P1089 20分求调!
查看原帖
P1089 20分求调!
1364355
luogujisuanji楼主2024/5/26 20:33
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int money,cost,m,mother,flag=1;
	for(int i=1;i<=12;i++)
    {
        money+=300;
        cin>>cost;
        money-=cost;
        if(money<0)
        {     
            flag=0;
            m=i;
            cout<<-m;
            return 0;
        }
        mother+=money;
        money%=100;     
    }    
    if(flag==1)
    {
        money+=mother*1.2;
        cout<<money;
    }
    return 0;
}
2024/5/26 20:33
加载中...