求助大神

P1089 [NOIP2004 提高组] 津津的储蓄计划

#include<iostream> #include<iomanip> #include<cmath> #include<cstdio> using namespace std; int main() { int ys,sum=0,sx=0; for(int i=1; i<=12; i++) { cin>>ys; int tmp=sx+300-ys; if(tmp<0) { cout<<-i<<endl; return 0; } sum+=tmp-tmp%100; sx=tmp%100; } sum+=sum*0.2+sx; cout<<sum<<endl; return 0; } //~~我最帅~~
by JeromeWang @ 2018-02-14 11:35:48


#include<iostream> #include<iomanip> #include<cmath> #include<cstdio> using namespace std; int main() { int ys,sum=0,sx=0; for(int i=1; i<=12; i++) { cin>>ys; int tmp=sx+300-ys; if(tmp<0) { cout<<-i<<endl; return 0; } sum+=tmp-tmp%100; sx=tmp%100; } sum+=sum*0.2+sx; cout<<sum<<endl; return 0; }
by JeromeWang @ 2018-02-14 11:36:55


捕捉妖王!@[保加利亚妖王](/space/show?uid=82794)
by lemir3 @ 2018-02-14 11:58:08


@[保加利亚妖王](/space/show?uid=82794) 。。。。只要思路就可以了,不要代码。
by 石哈哈 @ 2018-02-14 11:58:30


@[上善若水丶](/space/show?uid=54986) 你6。
by 石哈哈 @ 2018-02-14 11:58:56


|