标签:pac cin stdio.h struct turn include 排名 inf end
#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
struct StudentInfo {
string name, ID;
int grade;
}temp, maxa, minb;
int main() {
int n;
cin >> n;
maxa.grade = -1;
minb.grade = 101;
while (n--) {
cin >> temp.name >> temp.ID >> temp.grade;
if (temp.grade >= maxa.grade) {
maxa.grade = temp.grade;
maxa.name = temp.name;
maxa.ID = temp.ID;
}
if (temp.grade <= minb.grade) {
minb.grade = temp.grade;
minb.name = temp.name;
minb.ID = temp.ID;
}
}
cout << maxa.name << ‘ ‘ << maxa.ID << endl << minb.name << ‘ ‘ << minb.ID << endl;
return 0;
}
标签:pac cin stdio.h struct turn include 排名 inf end
原文地址:https://www.cnblogs.com/Yaxadu/p/10366640.html