year = 2012 if year % 100 != 0 and year % 4 == 0: print('闰年') elif year % 100 == 0 and year % 400 == 0: print('闰年') else: print('平年') 或者 print('*'*100) if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): print('闰年') else: print('平年') 四年一闰 百年不闰
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _03判断闰年 { class Program { static void Main(string[] args) { //举例:写一个方法,判断一个年份是否是润年. bool b = IsRun(2000); Console.WriteLine(