1004 outstanding issues in grade rankings

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.