Visual Studio软件
电脑
打开Visual Studio,选择新建项目。
代码 int year; for (int i = 0; i < 6; i++) { Console.Write('请输入年份: '); year = int.Parse(Console.ReadLine()); if (year % 4 == 0) { if (year % 100 == 0) { if (year % 400 == 0) Console.WriteLine('{0}年是闰年! ', year); else Console.WriteLine('{0}年不是闰年! ', year); } else { Console.WriteLine('{0}年是闰年! ', year); } } else { Console.WriteLine('{0}年不是闰年! ', year); } Console.ReadLine();
所有标点符号皆为英文状态下