首页 > 其他 > 详细

乙_1004 成绩排名 (20分)

时间:2020-05-22 19:17:36      阅读:54      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

 

 分析: 使用字符串拼接

#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;
}

乙_1004 成绩排名 (20分)

原文:https://www.cnblogs.com/xueshadouhui/p/12938875.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!