第四节课第二个作业

2018-10-31  本文已影响0人  流影随风

#编码

            Console.WriteLine("请输入年份:");

            string str_year = Console.ReadLine();      //输入年份

            int year = Convert.ToInt32(str_year);       //类型转换

            bool b = year % 400 == 0 || (year % 4 == 0 && year % 10 != 0);           //判断是否

            Console.WriteLine("是否正确:{0}",b);

            Console.ReadKey();

#效果

上一篇 下一篇

猜你喜欢

热点阅读