Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <clocale>
- #define ROWS 3
- #define COLS 4
- using namespace std;
- void main() {
- setlocale(LC_ALL, "Russian");
- int b[ROWS][COLS];
- int a[COLS][ROWS];
- for (int i = 0; i < ROWS; i++) {
- for (int j = 0; j < COLS; j++) {
- cin >> b[i][j];
- a[j][i] = b[i][j];
- }
- }
- cout << "Исходная матрица" << endl;
- for (int i = 0; i < ROWS; i++) {
- for (int j = 0; j < COLS; j++) {
- cout << b[i][j] << " ";
- }
- cout << endl;
- }
- cout << "Транспонированная матрица" << endl;
- for (int i = 0; i < COLS; i++) {
- for (int j = 0; j < ROWS; j++) {
- cout << a[i][j] << " ";
- }
- cout << endl;
- }
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement