首页 > 其他 > 详细

兔子生兔子

时间:2015-06-18 17:10:27      阅读:175      评论:0      收藏:0      [点我收藏+]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           int a = 0;//成兔
            int b = 0;//小兔
            int c = 1;//幼兔
            for (int mouth = 2; mouth <= 24;mouth++ )
            {
                a = a + b;
                b = c;
                c = a;

            Console.WriteLine("第{0}个月成兔:{1}小兔:{2}幼兔:{3}",mouth,a,b,c);

            }
            Console.WriteLine(a);
            Console.WriteLine(b);
            Console.WriteLine(c);
            Console.ReadLine();
        }
    }
}

 

兔子生兔子

原文:http://www.cnblogs.com/qixinjian/p/4586115.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!