class Program
{
public int yang(int cun) //求的羊的数量 已知的是村的个数
{
int sum = 0;
for (int i = 7; i>=cun ; i--)
{
if (i==7)
{
sum = 2;
}
else
{
sum = (2 * (sum + 1));
}
}
return sum;
}
static void Main(string[] args)
{
Console.WriteLine(new Program().yang(0));
Console.ReadLine();
}
}
时间: 2025-01-02 15:19:32