#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
while(n>=1)
{
cout << n << " ";
if(n%2==0)
{
n = n / 2;
}
else if(n == 1)
{
break;
}
else
{
n = n*3 + 1;
}
}
return 0;
}
角谷定理程序
最新推荐文章于 2024-07-24 22:13:06 发布