Question: please write me a c language code and keep it simple here is the specifications:In this project, you will implement a system that determines the
please write me a c language code and keep it simple here is the specifications:In this project, you will implement a system that determines the winnerand therunner upof a football tournament. Generally, football matches are played inrounds. In the first round, every two teams play one match and only the winnerqualifies to the next round. The winners of a round are reduced by half using thisprocedure. This continues until the final round where exactly two teams play andthe winner is declared as the champion. The loser of this final match isconsidered the second. However, some argue that this isunfair and that thesecond winner of the game should be the best team of all the teams that lostagainst the champion of the tournament.In this project, you will write a program to determine thewinner and therealrunnerup in the tournament. There are n teams denotedby n distinct integerIDs. These n teams will play in a cup manner until the champion is determined.The winner in any match is the team with the smaller ID if the round number isodd, or the team with the larger ID if the round number is even. If atanyround, the number of teams is odd, the last team in the list is qualifiedautomatically to the next round, but is placed in the head of the next list in theexample below, team qualifies automatically to round Similarly, team toround When the champion is determined, there will be another tournament therunneruptournament for all the teams that lost against the champion. Theseteams will be placed in the list in reverse order so that the team that lost to thechampion in the final round is placed first, and so on These teams will play againinanother tournamentwith the same rules usedbefore. The winner this time isthe realrunnerupFor example, the figure below shows a tournament offive teams IDs: and compete, and team is the cup champion. Teams that lost to team and play in the secondary tournament to determine the team in the secondplace The realrunnerupis team not In this program there will be no menu. Instead, your program will run onmultipleinput cases to test the validity and correctness of your code.Input format:Your program will be tested on multiple test cases. Each test case is written on asingle text line using the following format:n id id idnwhere n is the number of teams, and idiis the identifier for the ithteam and
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
