Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m[4][3];
- int a(0), b(0), c(0), d(0),i,j;
- for (i = 0; i < 4; i++)
- {
- cout << "Nhap hang thu " << i + 1 << endl;
- for (j = 0; j < 3; j++)
- {
- cout << "Nhap so thu " << j + 1 << ": ";
- cin >> m[i][j];
- cout << endl;
- }
- }
- for (i = 0; i < 3; i++)
- {
- a += m[0][i];
- b += m[1][i];
- c += m[2][i];
- d += m[3][i];
- }
- if (a == b && b == c && c==d)
- cout << "Tong cac phan tu tren cung mot hang bang nhau" << endl;
- else
- cout << "Tong cac phan tu tren cung mot hang khong bang nhau" << endl;
- cout << m[3][2];
- system("pause");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement