plaintext
struct Vector3D int x, y, z function checkEquilibrium(n)
sum := Vector3D(0, 0, 0)
for i from 1 to n
read fx, fy, fz sum.x := sum.x + fx sum.y := sum.y + fy sum.z := sum.z + fz
if sum.x == 0 and sum.y == 0 and sum.z == 0 then
print "YES"
else
print "NO"
You accumulate forces in the sum struct, then check all three components.