Fixed my old formatting and patched things that were left as-is due to burnout and laziness

This commit is contained in:
2024-12-06 15:14:33 +03:00
parent 02068890a5
commit 69d40c2dfb
7 changed files with 85 additions and 71 deletions

View File

@@ -1,26 +1,26 @@
#include <iostream>
using namespace std;
void move(int a, int b, int c, int n)
{
if (n == 1)
{
cout << "from " << a << " to " << c << endl;
}
else
{
move(a, c, b, n - 1);
cout << "from " << a << " to " << c << endl;
move(b, a, c, n - 1);
}
if (n == 1)
{
std::cout << "Из " << a << " в " << c << std::endl;
}
else
{
move(a, c, b, n - 1);
std::cout << "Из " << a << " в " << c << std::endl;
move(b, a, c, n - 1);
}
}
int main()
{
int n;
cout << "Enter the amount of disks: "; cin >> n;
setlocale(LC_ALL, "Russian");
int n;
std::cout << "Количество дисков: ";
std::cin >> n;
move(1, 2, 3, n);
}
move(1, 2, 3, n);
}