80分,大佬帮看下,谢谢

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

t应该是t+,有12个月的
by Chris韩梦倩 @ 2017-08-04 20:02:06


```cpp #include<bits/stdc++.h> using namespace std; int main() { int s=0; int t=0; for(int i=1;i<=12;i++){ int x; cin>>x; if(x<=s+300){ s+=300-x; }else{ cout<<'-'<<i<<endl; return 0; } if(s/100>=1){ t+=s/100*100; s-=s/100*100; } } cout<<t*1.2+s<<endl; return 0; }//这是我的方法 ```
by Chris韩梦倩 @ 2017-08-04 20:02:36


```cpp var i,ch,money,x,t:longint; f:boolean; begin f:=true; for i:=1 to 12 do begin readln(x); money:=money+300-x; if money<0 then begin f:=false;t:=i; end; ch:=ch+money div 100; money:=money mod 100; end; money:=money+ch*120; if f then writeln(money) else writeln(-t); end. 为什么也是80分 ```
by wangyuance @ 2017-08-05 08:20:38


|