PAT乙级1095 解码PAT准考证 (25 分)

 测试点1、4错误的话  检查你输出是不是3位或者6位 //printf("Case %d: %d %06d\n",i+1,zl,data);

#include 
using namespace std;
const int INF=100000000;
const int maxn=1111111;
struct st{
	string all;
	char rank;  //级别
	int room;  //考场日
	int data;  //日期
	string stuNo; //考生号
	int score; //分数
}stu[11111];
struct third{     //指令3专用结构体
	int room;   //考场号
	int sum;	//个数
	third(int r,int s):room(r),sum(s){}
};
bool cmp(st s1,st s2){
	if(s1.score!=s2.score){
		return s1.score>s2.score;
	}else return s1.allm2.sum;
	}else return m1.room v1,v2,v3;   //分别存顶级,甲级,乙级
	for(i=0;i>s>>score;
		stu[i].all=s;
		stu[i].rank=s[0];
		stu[i].room=stoi(s.substr(1,3));
		stu[i].data=stoi(s.substr(4,6));
		stu[i].stuNo=s.substr(10,3);
		stu[i].score=score;
		if(stu[i].rank=='T'){
			v1.push_back(stu[i]);   
		}else if(stu[i].rank=='A'){
			v2.push_back(stu[i]);
		}else if(stu[i].rank=='B'){
			v3.push_back(stu[i]);
		}
		a[stu[i].room]+=stu[i].score;  //使用数组a和数组num,直接存入指令2所需要的数据
		num[stu[i].room]++;
 
	}
	sort(v1.begin(),v1.end(),cmp);
	sort(v2.begin(),v2.end(),cmp);
	sort(v3.begin(),v3.end(),cmp);
 
	int zl,room,j;
	char rank;
	int data;
	for(i=0;i>rank;
			printf("Case %d: %d %c\n",i+1,zl,rank);
			if(rank=='T'){
				if(v1.empty()){printf("NA\n");continue;} 
				for(j=0;j mp;
			vector vm;
			scanf("%d",&data);
			printf("Case %d: %d %06d\n",i+1,zl,data);
			int flag=1;
			for(j=0;j

 

你可能感兴趣的:(PAT乙级)