Browse Source

添加 'A.cpp'

爱玲姐姐 5 years ago
parent
commit
42af011023
1 changed files with 22 additions and 0 deletions
  1. 22 0
      A.cpp

+ 22 - 0
A.cpp

@@ -0,0 +1,22 @@
+#include <bits/stdc++.h>
+using namespace std;
+int readint() {
+  int t;
+  cin >> t;
+  return t;
+}
+int main() {
+  int n;
+  cin >> n;
+  queue<int> v;
+  while (n--) v.push(readint());
+  while (v.size() > 1) {
+    int cur = v.front();
+    cout << cur << " ";
+    v.pop();
+    v.push(v.front());
+    v.pop();
+  }
+  cout << v.front() << endl;
+  return 0;
+}