Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- void ispis(int niz[20][20], int n) {
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= n; j++) {
- cout << niz[i][j] << " ";
- }
- cout << endl;
- }
- }
- void zamena(int niz[20][20], int n) {
- for (int i = 1; i <= n; i++) {
- for (int j = i; j <= n; j++) {
- swap(niz[i][j], niz[j][i]);
- }
- }
- }
- int n, x[20][20], i = 1, j = 1;
- int main() {
- cin >> n;
- for (i = 1; i <= n; i++) {
- for (j = 1; j <= n; j++) {
- cin >> x[i][j];
- }
- }
- ispis(x, n);
- zamena(x,n);
- ispis(x,n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement