From 9477dbe667f250ecd23f8fc0d56b942191526421 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Thu, 25 Feb 2021 14:42:55 +0100 Subject: Stare semestry, niepoukladane --- Semestr 3/pf/lista2/dwa.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Semestr 3/pf/lista2/dwa.cpp (limited to 'Semestr 3/pf/lista2/dwa.cpp') diff --git a/Semestr 3/pf/lista2/dwa.cpp b/Semestr 3/pf/lista2/dwa.cpp new file mode 100644 index 0000000..ba023d6 --- /dev/null +++ b/Semestr 3/pf/lista2/dwa.cpp @@ -0,0 +1,22 @@ +#include +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"; +} \ No newline at end of file -- cgit v1.2.3