using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入正整数");
int S = Convert.ToInt32(Console.ReadLine());
Console.Clear();//清除以上内容
int n = 0;
while (S !=1||n==0)
{
n = n + 1;
if (S % 2 == 0)
{
S = S / 2;
}
else
{
S = S * 3 + 1;
}
}
Console.WriteLine("一共输出了"+n.ToString()+"次数");
}
}
}