fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin>>n;
  7. int a = 0, b = 0, c = 0;
  8. for(int i =0;i<n;i++){
  9. int x, y, z;
  10. cin>>x>>y>>z;
  11. a+=x;
  12. b+=y;
  13. c+=z;
  14. }
  15. if((a==0)&&(b==0)&&(c==0)) cout<<"YES"<<endl;
  16. else cout<<"NO"<<endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 15232KB
stdin
3
3 -1 7
-5 2 -4
2 -1 -3
stdout
YES