C.cpp 349 B

12345678910111213141516171819202122
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int readint() {
  4. int t;
  5. cin >> t;
  6. return t;
  7. }
  8. int main() {
  9. int n;
  10. cin >> n;
  11. queue<int> v;
  12. while (n--) v.push(readint());
  13. while (v.size() > 1) {
  14. int cur = v.front();
  15. cout << cur << " ";
  16. v.pop();
  17. v.push(v.front());
  18. v.pop();
  19. }
  20. cout << v.front() << endl;
  21. return 0;
  22. }