卡拉兹函数,当n是奇数时,输出3*n+1,当n是偶数时,输出n/2
using System;
public class Program
{
public static void Main(string[] args)
{
int n = Convert.ToInt32(Console.ReadLine());
if (n % 2 != 0)
{
Console.WriteLine(3 * n + 1);
}
else
{
Console.WriteLine(n / 2);
}
}
}