解题说明:此题就是统计每一列数字之和是否为0,水题
#include <iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
int n,i;
int sum1,sum2,sum3;
int a[101],b[101],c[101];
scanf("%d",&n);
sum1=0;
sum2=0;
sum3=0;
for(i=0;i<n;i++)
{
scanf("%d %d %d",&a[i],&b[i],&c[i]);
sum1+=a[i];
sum2+=b[i];
sum3+=c[i];
}
if(sum1==0&&sum2==0&&sum3==0)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
return 0;
}