โ Back to Structs
Question 350
Read Students and Print the Top Scorer
Read Students and Print the Top Scorer
First read an integernfrom standard input, then readnlines, each with a student's name (a single word) and their integerscore. Store each into astruct Student { char name[32]; int score; }and print the name of the student with the highest score. For the input 3 Alice 85 Bob 92 Cara 78 the output is: Bob Assume all scores are distinct. There is no trailing newline.
Expected Output:
Bob
Topics:
Structs
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.