fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Console.Write("输入年份:");
  8. int year = int.Parse(Console.ReadLine());
  9.  
  10. bool isLeap = (year % 4 == 0) && (year % 100 != 0);
  11. Console.WriteLine($"{year}年{(isLeap ? "" : "不是")}闰年");
  12. }
  13. }
Success #stdin #stdout 0.04s 28232KB
stdin
2025
stdout
输入年份:2025年不是闰年