Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
32573 王籽易 津津的储蓄计划 C++ 通过 100 0 MS 252 KB 442 2022-02-12 14:33:19

Tests(3/3):


#include<bits/stdc++.h> using namespace std; int main(){ int leave=0,yusuan[13],month=0,mother=0; for(int i=1;i<=12;i++){ cin>>yusuan[i]; } for(int i=1;i<=12;i++){ leave+=300; leave-=yusuan[i]; if(leave>=100){ mother+=(leave/100)*100; leave=leave%100; } else if(leave<0){ month=i; break; } } if(month!=0) printf("-%d",month); else printf("%.0lf",leave+mother*1.2); return 0; }


测评信息: