提交时间:2024-01-18 15:57:23

运行 ID: 37021

#include<bits/stdc++.h> using namespace std; int a[20],b[20],c[20]; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]>>c[i]; } int sum1=0,sum2=0,sum3=0,cnt=0; for(int i=0;i<n;i++){ sum1+=a[i]; sum2+=b[i]; sum3+=c[i]; cnt+=(a[i]+b[i]+c[i]); } cout<<sum1<<" "<<sum2<<" "<<sum3<<" "<<cnt; }