球球大佬解答,谢谢!!!
查看原帖
球球大佬解答,谢谢!!!
1031106
SuperJAR楼主2024/3/11 19:11

这个程序哪里错啦??求求大佬解答!!!100分但没有通过

#include<iostream>
#include<fstream>
#include <iomanip>
#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
	int i,j;
	int max=0;
	int d=0;
	for(int a=1;a<=7;a++)
	{
		cin>>i>>j;
		if((i+j)>max&&(i+j)>=8)
		{
			max=i+j;
			d=a;
		}
	}
	cout<<d;


	return 0;
}

2024/3/11 19:11
加载中...