diff options
Diffstat (limited to '01_introductory_problems/permutations_1070.cpp')
| -rw-r--r-- | 01_introductory_problems/permutations_1070.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/01_introductory_problems/permutations_1070.cpp b/01_introductory_problems/permutations_1070.cpp new file mode 100644 index 0000000..4438795 --- /dev/null +++ b/01_introductory_problems/permutations_1070.cpp | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #include <iostream> | ||
| 2 | |||
| 3 | int main() { | ||
| 4 | int n; | ||
| 5 | std::cin >> n; | ||
| 6 | if (n == 2 || n == 3) { | ||
| 7 | std::cout << "NO SOLUTION" << std::endl; | ||
| 8 | } else { | ||
| 9 | for (int i = 2; i <= n; i += 2) | ||
| 10 | std::cout << i << " "; | ||
| 11 | for (int i = 1; i <= n; i += 2) | ||
| 12 | std::cout << i << " "; | ||
| 13 | std::cout << std::endl; | ||
| 14 | } | ||
| 15 | } | ||
