乙_1004 成绩排名 (20分)

 

 

 

 分析: 使用字符串拼接

#include <iostream>
#include <cstring>
using namespace std;
int main(){
 int score;
 string  tem1,tem2, stuma , stumi;
 int max=-1 ,  min=10000;
int n;
cin >> n;
while(n--){
 cin>> tem1>> tem2>>score;
 if(score>max) {
  max=score;
  stuma= tem1+ " "+ tem2;
 }
 if(score < min){
  min=score; 
  stumi= tem1+ " "+ tem2;
 }
 }
 cout << stuma<< endl ;
    cout<< stumi << endl;
 system("pause"); 
 return 0;
}
posted @ 2020-05-22 18:19  学啥都会  阅读(218)  评论(0编辑  收藏  举报