x+y+z来判断是否都为0,除非输入都是正数
#include <cstdio>using namespace std;int main(){int a,b,c,x,y,z,n;x = y = z = 0;scanf("%d",&n);for(int i = 0; i < n ;++i){scanf("%d%d%d",&a,&b,&c);x += a;y += b;z += c;}puts((x || y || z ? "NO":"YES"));return 0;}
[2016-03-22][CF][69A][Young Physicist]
原文:http://www.cnblogs.com/qhy285571052/p/ef8210674b4105364d43df62e1666950.html