Paste Search Dynamic
Recent pastes
swap mas
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {int mas [10000], n, i, k, m;
  7. cin >> n;
  8. for (i = 0; i < n; i++)
  9.         cin >> mas[i];
  10. cin >> k >> m;
  11. n = m;
  12. for(i = k; i < n; i++)
  13.         swap(mas[i], mas[n - i - 1]);
  14. for (i = 0; i < n; i++)
  15.         cout << mas[i] << ' ';
  16. }
Parsed in 0.002 seconds