Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int a[100][100],i,j,n,k,aux,m;
- cin>>n>>m;
- for(i=1;i<=n;i++)
- for(j=1;j<=m;j++)
- cin>>a[i][j];
- for(i=1;i<=n-1;i++)
- for(j=i+1;j<=m;j++)
- if(a[i][j]<a[j][i])
- {
- aux=a[i][j];
- a[i][j]=a[j][i];
- a[j][i]=aux;
- }
- for(i=1;i<=n;i++)
- {
- for(j=1;j<=n;j++)
- cout<<a[i][j]<<" ";
- cout<<endl;
- }
Add Comment
Please, Sign In to add comment