I'm solving this beginner problem on Codeforces, Young Physicist. https://codeforces.com/problemset/problem/69/A
The answer is to find if 3 forces are in equilibrium.
I've submitted two versions of my answers. One passed but one didn't. But I can't figure why it won't pass, aren't both of the condition same?
if (sumx == 0 && sumy == 0 && sumz == 0)
cout << "YES" << "\n";
else
cout << "NO" << "\n";
above is the one that passed.
if (sumx + sumy + sumz == 0)
cout << "YES" << "\n";
else
cout << "NO" << "\n";
this is the one that didn't pass.
