Advertisement
Denistod

Untitled

Nov 16th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int a[1001][1001];
  4. int main()
  5. {
  6. int n,m,i,j,aux;
  7. for(i=1;i<=n;i++)
  8. {
  9. for(j=1;j<=m;j++)
  10. {
  11. cin>>a[i][j];
  12. }
  13. }
  14. for(i=1;i<=n;i++)
  15. {
  16. for(j=1;j<=m;j++)
  17. {
  18. aux=a[i][j];
  19. a[i][j]=a[n-i+1][j];
  20. a[n-i+1][j]=aux;
  21. }
  22. }
  23. for(i=1;i<=n;i++)
  24. {
  25. for(j=1;j<=m;j++)
  26. {
  27. cout<<a[i][j]<<" ";
  28. }
  29. cout<<endl;
  30. }
  31. return 0;
  32. }
  33. 97
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement