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