Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, j, i, a[50][50], s = 0, S = 0;
- cin >> n;
- for (i = 1; i <= n; i++)
- for (j = 1; j <= n; j++)
- cin >> a[i][j];
- for (i = 1; i <= n; i++)
- for (j = 1; j <= n; j++)
- if (i < j)
- s = s + a[i][j];
- if (i > j)
- S = S + a[i][j];
- if (s > S)
- cout << "s=" << s;
- else
- cout << "S=" << S;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement