Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void interschimbcoloana(x,y)
- {
- int aux2=0;
- for(i=1;i<=n;i++)
- {
- aux2=c[i][x];
- c[i][x]=c[i][y];
- c[i][y]=aux2;
- }
- }
- int main()
- {
- int p,q,v[10][10],i,j;
- cout<<"Numar linii:"; cin>>p;
- cout<<"Numar coloane:"; cin>>q;
- for(i = 1 ; i <= p ; i++)
- for(j = 1 ; j <= q ;j++)
- {
- cout<<"v["<<i<<"]["<<j<<"]=";
- cin>>v[i][j];
- }
- interschimbcoloana(x,y);
- for(i=1;i<=p;i++)
- {
- for(j=1;j<=q;j++)
- cout<<v[i][j]<<" ";
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement