Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
51619 zhangsicun 奥运奖牌计数 C++ 通过 1 MS 260 KB 675 2024-09-22 21:59:53

Tests(1/1):


#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; }


测评信息: