#include <iostream> using namespace std; int main() { int n, Jin, Yin, Tong; int JinSum = 0, YinSum = 0, TongSum = 0, sum; cin >> n; for (int i = 1; i <= n; i++) // 循环n次 { cin >> Jin >> Yin >> Tong; // 输入一天获得的金银铜牌数 JinSum += Jin; // 金牌求和 YinSum += Yin; // 银牌求和 TongSum += Tong; // 铜牌求和 } sum = JinSum + YinSum + TongSum; // 求得总牌数 cout << JinSum << ' ' << YinSum << ' ' << TongSum << ' ' << sum; return 0; }