edutedu

problema 9

Jun 11th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. int a[100][100],i,j,n,k,aux,m;
  2. cin>>n>>m;
  3. for(i=1;i<=n;i++)
  4. for(j=1;j<=m;j++)
  5. cin>>a[i][j];
  6. for(i=1;i<=n-1;i++)
  7. for(j=i+1;j<=m;j++)
  8. if(a[i][j]<a[j][i])
  9. {
  10. aux=a[i][j];
  11. a[i][j]=a[j][i];
  12. a[j][i]=aux;
  13. }
  14. for(i=1;i<=n;i++)
  15. {
  16. for(j=1;j<=n;j++)
  17. cout<<a[i][j]<<" ";
  18. cout<<endl;
  19. }
Add Comment
Please, Sign In to add comment