Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- # define a 50
- # define b 50
- void Trasposta(int A[][b],int d,int e);
- int main ()
- {
- int d,e;
- //vetor int a[54]={2};
- // matriz int a[2][2]={{2,2},{2,2}}
- cout<<" quantas linhas deseja? "<<endl;
- cin>>d;
- cout<<" quantas colunas deseja "<<endl;
- cin>>e;
- int D[a][b];
- // linha
- for(int q=0; q<d; q++)
- {
- //coluna
- for(int Q=0; Q<e; Q++)
- {
- cin>>D[q][Q];
- }
- }
- /*
- for(int q=0; q<d; q++)
- {
- for(int Q=0; Q<e; Q++)
- {
- cout<<D[q][Q]<<" ";
- }
- cout<<endl;
- }
- */
- //matriz
- Trasposta(D,d,e);
- //vetor Trasposta(D,b,d,e);
- return 0;
- }
- void Trasposta(int A[][b],int d,int e)
- {
- for(int q=0; q<e; q++)
- {
- for(int Q=0; Q<d; Q++)
- {
- cout<<A[Q][q]<<" ";
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement