移植到C#下效果:
源码:
static void Main(string[] args)
{
long tick0, tick1;
tick0 = XXXXXXXXXXXw.Ticks; double a = 1, b = 0, c = 0; //关于兔子
double g = 1;
int n = 99;//需要计算的数据数
Console.WriteLine("第1月1");
for (int i = 1; i <= n; i++)
{
c=c+b;
b=a;
a=c;
g=a+c+b;
Console .WriteLine ("第{0}月{1}",i+1,g);
}
tick1 = XXXXXXXXXXXw.Ticks; Console.WriteLine("运算{0}次,耗时{1}微秒", n, (tick1 - tick0) / 10);
Console .ReadKey ();
}