Indian Premier League: Considering the success of IPL T20 league, some entrepreneurs decided that they will have a similar league for Hockey. In this league, there will be 10 teams, which will be called by a letter each. So teams are: ‘A’, ‘B’, ..., ‘J’. When the league starts, every day there will be some matches taking place. Information about the results has to be fed to a program, which should display the latest points table, after each result is fed to the program. The result would be in the following format: C5F3 (This means that in the hockey match, Team ‘C’ scored 5 goals, and Team ‘F’ scored 3 goals.) Points Table appears as below:
TEAM GAMES WINS LOSSES TIES GF GA POINTS
A 2 1 1 0 10 8 2
B . .
......
.....
In the points table, the columns are, total number of games played by that team, number of games that the team has won, lost or tied, Goals scored for the team, Goals scored against the team, and the points earned so far. The points are assigned as follows: 2 points for win, 1 for tie, 0 for loss. The teams have to be printed in the decreasing order of points. In case two teams have identical points, then the team having greater goal difference (GF – GA) will be considered higher. In case two teams have identical points and same goal difference then the teams can be in any order. Write a program that will take as input the result of one match, and output the points table after that match, and then input another result, and output updated points table, and do this till EOF.
Please send the code me on my mail ravirec07ec@gmail.com ........................... .........Please mail it ASAP................................
No comments:
Post a Comment