Advertisement
Guest User

a

a guest
Oct 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. # include <iostream>
  2.  
  3. using namespace std;
  4. # define a 50
  5. # define b 50
  6. void Trasposta(int A[][b],int d,int e);
  7.  
  8. int main ()
  9. {
  10. int d,e;
  11. //vetor int a[54]={2};
  12. // matriz int a[2][2]={{2,2},{2,2}}
  13. cout<<" quantas linhas deseja? "<<endl;
  14. cin>>d;
  15.  
  16. cout<<" quantas colunas deseja "<<endl;
  17. cin>>e;
  18.  
  19. int D[a][b];
  20.  
  21. // linha
  22. for(int q=0; q<d; q++)
  23. {
  24. //coluna
  25. for(int Q=0; Q<e; Q++)
  26. {
  27. cin>>D[q][Q];
  28.  
  29.  
  30.  
  31. }
  32.  
  33.  
  34.  
  35. }
  36. /*
  37. for(int q=0; q<d; q++)
  38. {
  39.  
  40. for(int Q=0; Q<e; Q++)
  41. {
  42. cout<<D[q][Q]<<" ";
  43.  
  44.  
  45.  
  46. }
  47. cout<<endl;
  48.  
  49.  
  50.  
  51. }
  52. */
  53. //matriz
  54. Trasposta(D,d,e);
  55.  
  56. //vetor Trasposta(D,b,d,e);
  57.  
  58.  
  59.  
  60.  
  61. return 0;
  62. }
  63.  
  64.  
  65. void Trasposta(int A[][b],int d,int e)
  66. {
  67.  
  68. for(int q=0; q<e; q++)
  69. {
  70.  
  71. for(int Q=0; Q<d; Q++)
  72. {
  73.  
  74. cout<<A[Q][q]<<" ";
  75.  
  76.  
  77.  
  78. }
  79. cout<<endl;
  80.  
  81.  
  82.  
  83. }
  84.  
  85.  
  86.  
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement