全是WA,不知道为什么
#include <bits/stdc++.h>
using namespace std;
struct stu{
char name[8];
int chinese;
int maths;
int english;
}arr[1001];
int main(){
int n;
cin >> n;
for(int i = 0;i < n;i++)
cin >> arr[i].name >> arr[i].chinese >> arr[i].maths >> arr[i].english;
for(int i = 0;i < n;i++){
for(int j = i + 1;j < n;j++){
int chi = arr[i].chinese - arr[j].chinese;
int mat = arr[i].maths - arr[j].maths;
int eng = arr[i].english - arr[j].english;
if(abs(chi) <= 5 && abs(mat) <= 5 && abs(eng) <= 5 && abs(chi+mat+eng) <= 10)
cout << arr[i].name << ' ' << arr[j].name << endl;
}
}
return 0;
}