为啥得80分
查看原帖
为啥得80分
740885
Zhangjunjia0202楼主2022/9/22 21:08
#include<bits/stdc++.h>
using namespace std;
int main(){
    int money=0,mama,cost,month;
    bool flag=true;
    for(int i=1;i<=12;i++){
        money+=300;
        cin>>cost;
        money-=cost;
        if(money<0){
            flag=false;
            month=i;
            break;
        }
    }
    mama+=money/100;
    money%=100;
    if(flag){
        money+=mama*120;
        cout<<money;
    }else{
        cout<<-month;
    }
    return 0;
}
2022/9/22 21:08
加载中...