fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "START\n";
  7.  
  8. int n;
  9. cin >> n;
  10.  
  11. int x;
  12. string z = "";
  13. string a = "";
  14.  
  15. for (int i = 0; i < n; ++i) {
  16. cin >> x;
  17. if (i % 2 == 0) {
  18. z += to_string(x) + " ";
  19. } else {
  20. a += to_string(x) + " ";
  21. }
  22. }
  23.  
  24. cout << z << endl;
  25. cout << a << endl;
  26.  
  27. cout << "KONIEC\n";
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 5320KB
stdin
0 1 2 3 4 5 6 7 8 9
stdout
START


KONIEC