第2个样例不对,why?
查看原帖
第2个样例不对,why?
1141385
dearChen02楼主2025/1/22 16:19

阿米诺斯

#include<bits/stdc++.h>
using namespace std;
int a[10];
int main(){
	int h=0;
	int maxn=-2147483647;
	for(int i=1;i<=5;i++){
		int sum=0;
		for(int j=1;j<=4;j++){
			cin>>a[j];
			sum+=a[j];
			if(sum>maxn){
				maxn=sum;
				h=j;
			}
		}
	}
	cout<<h<<" "<<maxn<<endl;
	return 0;
}
2025/1/22 16:19
加载中...