#include<iostream>
using namespace std;
int main()
{
    int a[101][3];
    int i, j, n;
    int total1 = 0, total2 = 0, total3 = 0;

    cin >> n;

    for (i = 0; i < n; i++) {
        for(j = 0; j < 3; j++) {
            cin >> a[i][j];
        }
    }

    for (i = 0; i < n; i++) {
        for(j = 0; j < 3; j++) {
            total1 += a[i][0];
            total2 += a[i][1];
            total3 += a[i][2];
        }
    }

    cout << endl << total1 << endl << total2 << endl << total3 << endl << endl;

    if (total1 == 0 && total2 == 0 && total3 == 0) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }
}

asked 25 Jun, 20:12

the%20catalyst's gravatar image

the catalyst
1018

edited 26 Jun, 11:16

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
1.0k18

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×136
×60
×1

question asked: 25 Jun, 20:12

question was seen: 50 times

last updated: 26 Jun, 11:16