Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
54369 | zhangweiran | 奥运奖牌计数 | C++ | 通过 | 1 MS | 244 KB | 675 | 2024-10-27 15:49:40 |
#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; }