Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
38671 | chenyifei | 津津的储蓄计划 | C++ | 通过 | 1 MS | 252 KB | 359 | 2024-01-27 21:11:45 |
#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; }