Lucian_Adrian

#770 PermCol

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