为啥我下载样例都过了,可还显示我是错的啊?
查看原帖
为啥我下载样例都过了,可还显示我是错的啊?
506649
昊轩啥也不是楼主2022/9/30 11:28

就是这样的,而且只得四十分,找不出错误,求大佬帮忙QAQ

#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;
}
2022/9/30 11:28
加载中...