diff options
author | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-02-25 14:42:55 +0100 |
---|---|---|
committer | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-02-25 14:42:55 +0100 |
commit | 9477dbe667f250ecd23f8fc0d56b942191526421 (patch) | |
tree | a4b50c9a726f415f835f5311c11c5d66e95f688c /Semestr 3/pf/lista2/cze.cpp | |
parent | 1968c1e590077bd51844eacfac722d7963848cb8 (diff) |
Stare semestry, niepoukladane
Diffstat (limited to 'Semestr 3/pf/lista2/cze.cpp')
-rw-r--r-- | Semestr 3/pf/lista2/cze.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Semestr 3/pf/lista2/cze.cpp b/Semestr 3/pf/lista2/cze.cpp new file mode 100644 index 0000000..da58fa5 --- /dev/null +++ b/Semestr 3/pf/lista2/cze.cpp @@ -0,0 +1,29 @@ +#include <iostream> +using namespace std; + +int tab[1000010]; + +int main() +{ + int wsk = 0; + + while (true) + { + cin >> tab[wsk]; + if (tab[wsk] == -1) + break; + wsk++; + } + + for (int i = 0; i < wsk; i += 2) // i += 2 <=> i = i + 2 + { + cout << tab[i] << " "; + } + cout << "-1\n"; + + for (int i = 1; i < wsk; i += 2) + { + cout << tab[i] << " "; + } + cout << "-1\n"; +}
\ No newline at end of file |