Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int matrix[100][100],n,i,j,m;
- cout<<"n=";cin>>n;
- cout<<"m=";cin>>m;
- for (i=0;i<n;i++)
- for (j=0;j<m;j++)
- cin>>matrix[i][j];
- //transpunere
- int n_t,m_t,matrix_t[100][100];
- n_t=m;
- m_t=n;
- for (i=0;i<n_t;i++)
- for (j=0;j<m_t;j++)
- matrix_t[i][j]=matrix[j][i];
- for (i=0;i<n_t;i++) {
- for (j=0;j<m_t;j++)
- cout<<matrix_t[i][j]<<' ';
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement