首页 > 其他 > 详细

【PAT】B1041 考试座位号(15 分)

时间:2018-08-18 18:23:36      阅读:220      评论:0      收藏:0      [点我收藏+]

/*

*/
#include<stdio.h>
#include<algorithm>
using namespace std;
struct stu{
    char number[18];
    int shi,kao;
}arr[1005];
bool cmp(stu A,stu B){
    return A.shi<B.shi;
}
int main(){
    int N,N1,temp;
    scanf("%d",&N);
    for(int i=1;i<=N;i++){
        scanf(" %s %d %d",arr[i].number,&arr[i].shi,&arr[i].kao);
    }
    sort(&arr[1],&arr[N+1],cmp);
    scanf("%d",&N1);
    for(int i=0;i<N1;i++){
        if(i!=0) printf("\n");
        scanf("%d",&temp);
        printf("%s %d",arr[temp].number,arr[temp].kao);
    }
    return  0;
}

【PAT】B1041 考试座位号(15 分)

原文:https://www.cnblogs.com/hebust/p/9498026.html

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