l1-005. Test seat number time limit MS Memory limit 65536 KB code length limit 8000 B procedure StandardAuthor Chen
Each PAT candidate will be assigned two seat numbers, one for the test seat and one for the test seat, when taking the exam. Under normal circumstances, candidates in the entrance of the first to obtain the seat number of the test machine, seated into the test machine status, the system will show the test seat number of the candidate, the test candidates need to change to the test seat seating. But some of the candidates are late, the test machine is over, they can only take the seat number of the test machine to you, from the backstage to find out their test seat number.
Input format:
Enter the first line to give a positive integer n (<=1000), followed by n lines, each row gives a candidate's information: "The ticket Number test machine seat number examination seat number." Where the ticket number consists of 14 digits, the seats are numbered from 1 to N. The input guarantees that each person's ticket number is different and will not assign two people to the same seat at any time.
After the candidate information, a positive integer m (<=n) is given, followed by a line of M to query the test machine seat number, separated by a space.
Output format:
corresponding to each need to query the seat number of the test machine, in a row to output the corresponding candidate's ticket number and test seat number, in the middle with 1 spaces separated.
Input Sample:
410120150912233 2 410120150912119 4 110120150912126 1 310120150912002 3 223 4
Sample output:
10120150912002 210120150912119 1
1#include <bits/stdc++.h>2 using namespacestd;3 structNode4 {5 strings;6 inttest;7 intfact;8} a[1010];9 intMain ()Ten { One intn,m,b[1010]; ACin>>N; - for(intI=0; i<n; i++) -Cin>>a[i].s>>a[i].test>>a[i].fact; theCin>>m; - for(intI=0; i<m; i++) -Cin>>B[i]; - for(intI=0; i<m; i++) + { - for(intj=0; j<n; J + +) + { A if(b[i]==a[j].test) at { -cout<<a[j].s<<" "<<a[j].fact<<Endl; - Break; - } - } - } in return 0; -}
l1-005. Test seat number