Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int n,a[100][100],i,j,aux;
  5. int main()
  6. {
  7. cin>>n;
  8. for(i=0;i<n;i++)
  9. {
  10. for(j=0;j<n;j++)
  11. cin>>a[i][j];
  12. }for(i=0;i<n;i++)
  13. {
  14. for(j=0;j<i;j++)
  15. {
  16. aux=a[i][j];
  17. a[i][j]=a[j][i];
  18. a[j][i]=aux;}}
  19. for(i=0;i<n;i++){
  20. for(j=0;j<n;j++)
  21. cout<<a[i][j]<<' ';
  22. cout<<endl;
  23. }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement