1004 Results Rankings (20 points)
Read n (>0) Students ' names, school numbers, and grades, respectively, with the highest and lowest grade students ' names and school numbers.
Input format:
Each test input contains 1 test cases in the form
第 1 行:正整数 n第 2 行:第 1 个学生的姓名 学号 成绩第 3 行:第 2 个学生的姓名 学号 成绩 ... ... ...第 n+1 行:第 n 个学生的姓名 学号 成绩
Input Sample:
3Joe Math990112 89Mike CS991301 100Mary EE990830 95
Sample output:
Mike CS991301Joe Math990112
1#include"stdafx.h"2#include <algorithm>3#include <iostream>4 5 using namespacestd;6 structStudent {7 Charname[Ten];8 Charnum[Ten];9 intscore;Ten}stu[10010]; One BOOLCOM (student A, student B) A { - returnA.score <B.score; - the } - voidswap (Student A, student B) { - student C; -c =A; +A =b; -b =C; + } A intMain () at { - intN; -CIN >>N; - for(inti =0; I < n; i++) { -CIN >> Stu[i].name >> stu[i].num >>Stu[i].score; - } in for(inti =0; I <= N; i++) { - if(COM (stu[i], stu[i +1])) toSwap (Stu[i], stu[i +1]); + } - for(inti = n; i>=0; i--) { the if(i==n-1) *cout << Stu[i].name <<" "<< stu[i].num<<"\ n"; $ if(i = =0)Panax Notoginsengcout << stu[i].name<<" "<<Stu[i].num; - the } + A the return 0; +}
Why would/******* print out y*****************/
1004 outstanding issues in grade rankings