fork download
  1. // Online C++ compiler to run C++ program online
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. // Write C++ code here
  8. int n, sum=0;
  9. cin >> n;
  10.  
  11. for(int i=0; i<n; i ++){
  12. int x, y, z;
  13. cin >> x >> y >> z;
  14.  
  15. sum += (x+y+z);
  16. }
  17.  
  18. if(sum == 0) cout << "YES\n";
  19. else cout << "NO\n";
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
NO