Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define MAX 100
- int main() {
- int a[MAX][MAX];
- int soDong;
- int soCot;
- cout << "NHap so dong:";
- cin >> soDong;
- cout << "nhap so cot :";
- cin >> soCot;
- for (int i = 0; i < soDong; i++) {
- for (int j = 0; j < soCot; j++) {
- cout << "Nhap a[" << i << "][" << j << "]";
- cin >> a[i][j];
- }
- }
- int b[MAX][MAX];
- for (int i = 0; i < soCot; i++) {
- for (int j = 0; j < soDong; j++) {
- b[i][j] = a[j][i];
- }
- }
- cout << "\t" << "MA TRAN BAN DAU " << endl;
- for (int i = 0; i < soDong; i++) {
- for (int j = 0; j < soCot; j++) {
- cout << "\t" << a[i][j];
- }
- cout << endl;
- }
- cout << "\t " << "MA TRAN CHUYEN VI " << endl;
- for (int i = 0; i < soCot; i++) {
- for (int j = 0; j < soDong; j++) {
- cout << "\t"<< b[i][j];
- }
- cout << endl;
- }
- system("pause>NULL");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement