From a3bb13b641af09c85a2497ad2f88502585d673aa Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Sun, 15 May 2022 00:31:07 +0200 Subject: Solved YoungPhysicist.cpp --- YoungPhysicist.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 YoungPhysicist.cpp diff --git a/YoungPhysicist.cpp b/YoungPhysicist.cpp new file mode 100644 index 0000000..b126bd1 --- /dev/null +++ b/YoungPhysicist.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; +int main() { + int n; + cin >> n; + vector> v(n); + for(int i = 0; i < n; i++) { + for(int j = 0; j < 3; j++) { + int x; + cin >> x; + v[i].push_back(x); + } + } + int x = 0, y = 0, z = 0; + for(int i = 0; i < n; i++) { + x+=v[i][0]; + y+=v[i][1]; + z+=v[i][2]; + } + cout << ((x == 0 && y == 0 && z == 0) ? "YES" : "NO") << endl; + +} -- cgit v1.2.3