【发布时间】:2019-10-16 16:30:09
【问题描述】:
我是编码新手 - 刚刚开始。构建成功,但我想添加输入输出以获得消费者响应,以检查它是否真的有效。谢谢
using System;
namespace LeapYear
{
public static class Leap
{
static void Main(string[] args)
{
Console.WriteLine("Enter a year ");
Console.ReadLine();
}
public static bool IsLeapYear(int year)
{
if (year % 4 == 0 && year % 100 != 0 || year % 400 ==0)
{
return true;
}
return false;
}
}
}
【问题讨论】:
-
仅供参考:Dotnet 框架已经为
IsLeapYeardocs.microsoft.com/en-us/dotnet/api/… 提供了一个方法
标签: c# input output console-application