标签:
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();
}
}
标签:
原文地址:http://www.cnblogs.com/Mr-xue/p/4423556.html