MohamedAbdel3al

W. Mirror Array

Aug 18th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <bits/stdc++.h>
  4. using namespace std ;
  5. typedef long long ll ;
  6.  
  7. void ABDEL3AL () {
  8. ios_base::sync_with_stdio(false) , cin.tie(nullptr) , cout.tie(nullptr) ;
  9. #ifndef ONLINE_JUDGE
  10. freopen("input.txt" , "r" ,stdin) , freopen("output.txt" , "w" , stdout) ;
  11. #endif
  12. }
  13.  
  14. int main() {
  15. ABDEL3AL() ;
  16. int n , m ;
  17. cin >> n >> m ;
  18. for (int i = 0; i < n; i++) {
  19. ll arr[m] ;
  20. for (int i = 0 ; i < m && cin >> arr[i]; i++);
  21. reverse (arr , arr + m) ;
  22. for (int i = 0; i < m && cout << arr[i] << " "; i++);
  23. cout << "\n" ;
  24. }
  25.  
  26. return 0;
  27.  
  28. }
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment