美文网首页
第四次作业第二题

第四次作业第二题

作者: 似是而非_30f0 | 来源:发表于2018-10-31 15:55 被阅读0次

#代码

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication5

{

    class Program

    {

        static void Main(string[] args)

        {

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

            string str_year = Console.ReadLine();

            int year = Convert.ToInt32(str_year);

            bool b = year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);

            Console.WriteLine("你输入的年份是:{0},输入的结果是不是闰年{1}", year, b);

            Console.ReadKey();

        }

    }

}

相关文章

网友评论

      本文标题:第四次作业第二题

      本文链接:https://www.haomeiwen.com/subject/tdmatqtx.html