提交时间:2024-01-20 13:18:48
运行 ID: 37372
#include <iostream> using namespace std; int main() { int n; cin>>n; int medals[3]={0}; for (int i=0;i<n;i++) { int g,s,b; cin>>g>>s>>b; medals[0]+=g; medals[1]+=s; medals[2]+=b; } int total=medals[0]+medals[1]+medals[2]; for(int i=0;i<3;i++) { cout<<medals[i]<<" "; } cout<<total<<endl; return 0; }