考试座位号

注意到t,这个二维数组是按照t,即试机座位号存储准考号和座位号,所以最终只需要给定t,便可的出信息

// 考试座位号.cpp : 定义控制台应用程序的入口点。
//注意到t,这个二维数组是按照t,即试机座位号存储准考
//号和座位号,所以最终只需要给定t,便可的出信息

#include "stdafx.h"
#include
#include
using namespace std;


int main()
{
	string stu[1005][2], s1, s2;
	int n, m, t;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> s1 >> t >> s2;
		stu[t][0] = s1;
		stu[t][1] = s2;//用二维数组存放准考证号和考试座位号

	}
	cin >> m;
	for (int i = 0;i < m;i++) {
		cin >> t;
		cout << stu[t][0] << " " << stu[t][1] << endl;

	}
	system("pause");
		return 0;
}

 

你可能感兴趣的:(pat)