Answered step by step
Verified Expert Solution
Question
1 Approved Answer
mara:Pls help for this programing problem in c++ (standard IO without file read/write),better with some comment about why coding that way,thanks Problem C: Marathon Time
mara:Pls help for this programing problem in c++ (standard IO without file read/write),better with some comment about why coding that way,thanks
Problem C: Marathon Time limit: 2 seconds Problem Description In 2010/11/6, Chinese Taipei Road Running Association (CTRRA for short) held the Taroko Gorge Marathon. There are thousands of people join. CTRRA needs a program to record the marathoners finish time and find the best three marathoners for awarding prizes. Please write a program such that after users enter the players IDs and grades, the program prints the best three in the correct order. If there are less than three players, then print all of them. We assume that all the grades are different. Input Format There are several test cases. The first line of each test case contains an integer n which indicates the number of players. In the following n lines, each line contains the record of one player, an ID followed by a grade. An ID is a positive integer at most 9999, and n is at most 100. The case with n 0 indicates the end of the input, and you do not need to process it. Output Format Print the best three players and their grades, separated by a space Sample Input Sample Output 6789 218 8912 2'20 1234 2'13 4567 216 1234 2'13 4567 216 6789 2 18 ase 2: 1002 333 1003 344 1003 3'44 1002 3 33Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started