Skip to content

Instantly share code, notes, and snippets.

@lazycipher
Created October 9, 2019 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lazycipher/89559a817cca59d0683d5434826fc0c1 to your computer and use it in GitHub Desktop.
Save lazycipher/89559a817cca59d0683d5434826fc0c1 to your computer and use it in GitHub Desktop.
69A - Young Physicist Solution in C++
#include<iostream>
int main(){
int n, x, y, z, xf(0), yf(0) ,zf(0);
std::cin>>n;
for(int i=0; i<n; i++){
std::cin>>x>>y>>z;
xf+=x;
yf+=y;
zf+=z;
}
if(xf==0 && yf==0 && zf==0){
std::cout<<"YES";
}else{
std::cout<<"NO";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment