提交时间:2024-12-05 21:16:26
运行 ID: 58263
#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; }