社区讨论
为啥我下载样例都过了,可还显示我是错的啊?
P1089[NOIP 2004 提高组] 津津的储蓄计划参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @lo7xqg5g
- 此快照首次捕获于
- 2023/10/27 09:29 2 年前
- 此快照最后确认于
- 2023/10/27 09:29 2 年前
就是这样的,而且只得四十分,找不出错误,求大佬帮忙QAQ
CPP#include<bits/stdc++.h>
using namespace std;
int main(){
int a[13],ans=0,t[13]={0};
for(int i=1;i<=12;i++)
cin>>a[i];
int temp=0,k=0;
for(int i=1;i<=12;i++){
t[i]=k-a[i]+300;
if(t[i]<0){
cout<<"-"<<i;
return 0;
}
temp=t[i]%100;
k=temp;
ans+=t[i]/100<1?0:t[i]/100;
}
cout<<ans<<endl;
cout<<int(k+ans*1.2*100);
return 0;
}
回复
共 1 条回复,欢迎继续交流。
正在加载回复...