只有1468过了,请问大家是什么地方出了问题呢

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

```cpp #include <cstdio> using namespace std; int main() { int yu[12]; int baicnt=0; int money=0; for (int i=1;i<=12;i++) { scanf("%d",&yu[i]); money+=300; money-=yu[i]; if (money<0) { printf("-%d",i); return 0; } baicnt+=money/100; money%=100; } printf("%d",money+baicnt*120); return 0; } ``` 发个代码看看吧
by 二马Junco @ 2022-02-22 19:07:05


``` #include<bits/stdc++.h> using namespace std; int main() { long long a,i,e=0,f,g=300,h,j=0; for(i=1;i<=12;i++){ cin>>a; if(a<=g && g-a>=100){ f=(g-a)/100; e=e+f; g=g-a-f*100; } else{ if(a>g && j==0){ h=i; j=1; } g=g-a; } g=g+300; } if(j==1){ cout<<"-"<<h; } else{ cout<<e*100+e*100*0.2+g-300; } return 0; } ```
by AiGeeeeeeee @ 2022-03-05 09:54:25


e[i] >= 100 最后除了妈妈手里的乘以1.2,还要加上他手里还剩下的
by denghongj @ 2022-05-29 21:15:55


|