aboutsummaryrefslogtreecommitdiff
path: root/semestr-3/pf/lista2/dwa.cpp
blob: ba023d65a08b25750e21382bdaa2e53132f0aa2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
using namespace std;

int t[1000004];

int main()
{
  int i = 0;
  while (true)
  {
    cin >> t[i];
    if (t[i] == -1)
      break;
    i++;
  }
  for (int j = 0; j < i; j += 2)
    cout << t[j] << " ";
  cout << "-1\n";
  for (int j = 1; j < i; j += 2)
    cout << t[j] << " ";
  cout << "-1\n";
}