Describe
In the 2008 Beijing Olympics, a country's athletes participated in the N-Day final project (1≤N≤17). Now we need to count the number of gold, silver, bronze medals and total medals received by country A.
Enter input n+1 line, line 1th is the number of days that a country participates in the final project N, followed by n lines, each row is the number of gold, silver, bronze medals obtained on one day of the country, separated by a space. Output 1 lines, including 4 integers, the total number of gold, silver, bronze medals and total medals obtained by country A, separated by a single space. Sample input
31 0 33 1 00 3 0
Sample output
4 4 3 11
1#include <iostream>2#include <cstdio>3 using namespacestd;4 intMain ()5 {6 inta,x,y,z,jin=0, yin=0, ton=0, B;7 //double x;8Cin>>A;9 for(intI=0; i<a;i++)Ten { OneCin>>x>>y>>Z; Ajin+=x; -yin+=y; -ton+=Z;} theb=jin+yin+ton; -printf"%d %d%d%d", jin,yin,ton,b); - return 0; -}
Fundamentals of Programming Cycle basics