Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <algorithm>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. ifstream in("antiqs.in");
  10. ofstream out("antiqs.out");
  11. int n;
  12. in >> n;
  13. int M[n];
  14. for(int i = 1; i < n + 1; i++)
  15. M[i - 1] = i;
  16. for(int i = 0; i < n; i++)
  17. swap(M[i],M[i/2]);
  18. for(int i = 0; i < n; i++)
  19. out << M[i] << ' ';
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement