1. Jojo and his classmates like to answer question not in sequence. This make their teacher confuse when checking their answer. So their teacher asked you to sort their answer by the smallest number to the largest, it is guranteed that all number only appear once. Because you don't have time to do it manually you have to make a program to read input from "testdata.in" and output the sorted sequence of given answer in console. To make this problem easier try using struct. Format Input The first line contain an integer T represents the number of test cases. Each test case start with integer N represents how many answer there are. The next N-lines is formatted "A. X" where A is an integer represents the problem's number and X is a character represents the answer. Format Output The sorted answer for each test cases. Constraints 1 <= T <= 20 1 <= N <= 100 1 <= A <= N It is guaranteed that A is all distinct in a single test case. It is guaranteed that X is an uppercase character.
1. Jojo and his classmates like to answer question not in sequence. This make their teacher confuse when checking their answer. So their teacher asked you to sort their answer by the smallest number to the largest, it is guranteed that all number only appear once. Because you don't have time to do it manually you have to make a program to read input from "testdata.in" and output the sorted sequence of given answer in console. To make this problem easier try using struct.
Format Input
The first line contain an integer T represents the number of test cases. Each test case start with integer N represents how many answer there are. The next N-lines is formatted "A. X" where A is an integer represents the problem's number and X is a character represents the answer.
Format Output
The sorted answer for each test cases.
Constraints
1 <= T <= 20
1 <= N <= 100
1 <= A <= N
It is guaranteed that A is all distinct in a single test case.
It is guaranteed that X is an uppercase character.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images