This commit is contained in:
Arthur K. 2025-05-29 19:24:43 +03:00
commit 810a9654a4
Signed by: wzray
GPG key ID: B97F30FDC4636357
50 changed files with 4450 additions and 0 deletions

22
2/D.cpp Normal file
View file

@ -0,0 +1,22 @@
#include <iostream>
int main() {
int n;
std::cin >> n;
int* a = new int[n];
for (int i = 1; i <= n; ++i) {
a[i-1] = i;
}
for (int i = 2; i < n; ++i) {
std::swap(a[i], a[i/2]);
}
for (int i = 0; i < n; ++i) {
std::cout << a[i] << " ";
}
delete[] a;
return 0;
}