第四节课第二个作业

#编码

            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();

#效果


第四节课第二个作业_第1张图片

你可能感兴趣的:(第四节课第二个作业)