Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void interschimbcoloana(x,y)
  5. {
  6. int aux2=0;
  7. for(i=1;i<=n;i++)
  8. {
  9. aux2=c[i][x];
  10. c[i][x]=c[i][y];
  11. c[i][y]=aux2;
  12. }
  13. }
  14.  
  15. int main()
  16. {
  17. int p,q,v[10][10],i,j;
  18. cout<<"Numar linii:"; cin>>p;
  19. cout<<"Numar coloane:"; cin>>q;
  20.  
  21.  
  22. for(i = 1 ; i <= p ; i++)
  23.  
  24. for(j = 1 ; j <= q ;j++)
  25. {
  26.  
  27. cout<<"v["<<i<<"]["<<j<<"]=";
  28. cin>>v[i][j];
  29.  
  30. }
  31.  
  32. interschimbcoloana(x,y);
  33.  
  34. for(i=1;i<=p;i++)
  35. {
  36. for(j=1;j<=q;j++)
  37.  
  38.  
  39.  
  40.  
  41. cout<<v[i][j]<<" ";
  42. cout<<endl;
  43.  
  44.  
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement