不知我哪错了,求大佬帮助(c党)

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

@[四大神笔](/space/show?uid=168013) ```cpp #include<bits/stdc++.h> using namespace std; int a[15]; int main() { long long n,sum=0,x=0,y=0,m=0; for(int i=0;i<12;i++) { cin>>a[i]; } for(int i=0;i<12;i++) { y=300-a[i]+y; m+=y/100*100; y=y%100; if(y>=0) sum++; else { sum++; cout<<"-"<<sum; return 0; } } cout<<y+m*1.2; return 0; } ```
by 幻之陨梦 @ 2019-06-26 13:26:33


```c #include <stdio.h> #include <stdlib.h> int main() { int plan[13],hand=0,save=0,i; for(i=1;i<12;i++) { scanf("%d\n",&plan[i]); } for(i=1;i<12;i++) { hand=hand+300; hand=hand-plan[i]; if(hand < 0) { printf("-%d",i); return 0; } else { save=save+hand/100; hand=hand%100; } } hand=hand+300+save*100+save*20; printf("%d",hand); return 0; } ``` @[ZhanLang](/space/show?uid=123808) 同求
by Roy_king @ 2019-07-17 11:40:06


|