Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
32573 王籽易 津津的储蓄计划 C++ Accepted 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; }


Judgement Protocol: