-->
当前位置:首页 > 题库

PROGRAMMING:Olympic medal count

Luz5年前 (2021-05-10)题库421
###Task description
In the 2008 Beijing Olympic Games, the athletes of country a participated in the n-day finals (1 ≤ n ≤ 17). Now let's count the number of gold, silver and bronze medals won by country a and the total number of medals.
###Input format:
Enter n + 1 line. The first line is the number of days n for country a to participate in the finals, followed by N lines. Each line is the number of gold, silver and bronze medals won by the country on a certain day, separated by a space.
###Output format:
Output 1 line, including 4 integers, which are the total number of gold, silver and bronze medals and the total number of medals won by country a, separated by a space.
###Input example:
```in
three
1 0 3
3 1 0
0 3 0
```
###Output example:
```out
4 4 3 11
```
###Title Source
Note: this topic is selected from openjudge website http://noi.openjudge.cn/ch0105/07/
Problem analysis:
In this problem, we still need to read the integer n first, and then read three integers each time through N cycles, representing the number of gold, silver and bronze medals respectively, and add them to the sum of the number of gold, silver and bronze medals respectively.







answer:If there is no answer, please comment