1 条题解
-
0
#include #include using namespace std; int main() { struct Student { string name; int chinese, m, e, sum; }student[1000]; int N; cin>>N; for (int i = 0; i < N; i++) { cin>>student[i].name>>student[i].chinese>>student[i].m>>student[i].e; student[i].sum = student[i].chinese + student[i].m + student[i].e; } for (int i = 0; i < N - 1; i++) { for (int j = i + 1; j < N; j++) { if (abs(student[i].chinese - student[j].chinese) <= 5 && abs(student[i].m - student[j].m) <= 5 && abs(student[i].e - student[j].e) <= 5 && abs(student[i].sum - student[j].sum) <= 10) { if (student[i].name < student[j].name) cout<<student[i].name << " " << student[j].name << "\n"; else cout<<student[j].name << " " << student[i].name << "\n"; } } } return 0; }
信息
- ID
- 938
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- (无)
- 递交数
- 15
- 已通过
- 5
- 上传者