提交时间:2024-11-15 19:26:32
运行 ID: 56760
#include<bits/stdc++.h> using namespace std; int main(){ int n,days; int gold,silver,copper; int goldinall=0,silverinall=0,copperinall=0; int medalsinall; cin>>n; days=n; while(n>=1){ cin>>gold>>silver>>copper; goldinall+=gold; silverinall+=silver; copperinall+=copper; medalsinall+=gold+silver+copper; n-=1; } cout<<goldinall<<" "<<silverinall<<" "<<copperinall<<" "<<medalsinall; return 0; }