'reading data and implementing structs in c code

Can anyone please help me understand what's the optimal way to read data in this task? is fgets more suitable? Also do i need to create multiple structs or just one? thank you.

Task: Sharpshooting • Create a struct for storing competitor's name and his/her 10 results. • Read data from keyboard (or from file). • Calculate for each competitor the total points and number of bullseyes. • Sort the competitors according to total points in descending order. If the number of points is equal then the one with more bullseyes is better. • Write a program that prints top 5 competitors. • ADDITIONAL: Write an interactive program with menu where • It's possible to add results several times. • If a competitor is already present then only the better result will be stored.

c


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source