提交时间:2024-01-27 21:11:45
运行 ID: 38671
#include<iostream> using namespace std; int now_money=0,cost,saved_money=0; int main(){ for(int i=1;i<=12;i++){ cin>>cost; now_money+=300; now_money-=cost; if(now_money<0){ cout<<"-"<<i<<endl; return 0; } int mus=now_money/100; now_money-=(mus*100); saved_money+=(mus*100); } now_money+=(1.2*saved_money); cout<<now_money<<endl; return 0; }