#include<iostream>usingnamespace std;struct Person {
string m_Name;
string m_id;int m_soc;}stu[1000],res[1000];voidtest(){int m =0;
cin >> m;for(int i =0; i < m; i++){
string name;
string id;int soc;
cin >> name;
cin >> id;
cin >> soc;
stu[i].m_Name = name;
stu[i].m_id = id;
stu[i].m_soc = soc;}int max =0;for(int i =0; i < m; i++){if(stu[i].m_soc > max){
max = stu[i].m_soc;}}for(int i =0; i < m; i++){if(stu[i].m_soc == max){
cout << stu[i].m_Name <<" "<< stu[i].m_id << endl;}}int min =100;for(int i =0; i < m; i++){if(stu[i].m_soc < min){
min = stu[i].m_soc;}}for(int i =0; i < m; i++){if(stu[i].m_soc == min){
cout << stu[i].m_Name <<" "<< stu[i].m_id << endl;}}}intmain(){test();return0;}
【PAT-B1004】 成绩排名 (20分)(c++)#include<iostream>using namespace std;struct Person { string m_Name; string m_id; int m_soc;}stu[1000],res[1000];void test(){ int m = 0; cin >> m; for (int i = 0; i < m; i++) { string name; string