提交时间:2024-10-27 15:49:40
运行 ID: 54369
#include<bits/stdc++.h> using namespace std; int main(){ int days, goldenmedalsperday, silvermedalsperday, bronzemedalsperday; int sum = 0; int goldenmedals = 0; int silvermedals = 0; int bronzemedals = 0; cin >> days; for(int i = 0;i < days;i++){ cin >> goldenmedalsperday >> silvermedalsperday >> bronzemedalsperday; goldenmedals += goldenmedalsperday; silvermedals += silvermedalsperday; bronzemedals += bronzemedalsperday; sum= sum + goldenmedalsperday + silvermedalsperday + bronzemedalsperday; } cout << goldenmedals << " " << silvermedals << " " << bronzemedals << " " << sum; }