Aimo:
Задание 2.
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
int n;
cin >> n;
while(true)
{
cout << n << " ";
if (n == 1)
{
break;
}
else if (n % 2 == 0)
{
n /= 2;
}
else if (n % 2 == 1)
{
n *= 3;
n++;
}
}
cout << endl;
return 0;
}
Задание 3.
#include <iostream>
Shchurov