using System;
namespace _019_while循环_编程题
{
class Program
{
static void Main(string[] args)
{
int n = Convert.ToInt32(Console.ReadLine());
int j = 0;
while (n != 1)
{
if (n % 2 == 1)
{
n = 3 * n + 1;
}
else
{
n /= 2;
}
j++;
Console.WriteLine("变换后的值为:" + n);
}
Console.WriteLine(" 变换的次数为:" + j);
}
}
}