Console.WriteLine("請輸入要判斷的年份");
int year = Convert.ToInt32(Console.ReadLine());
//年份能夠被400整除。(2000)
//年份能被4整除,但是不能被100整除。(2008)
//邏輯與的優先級高於邏輯或,最好關系運算式加括號便於閱讀
bool result = (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
Console.WriteLine(result);
Console.ReadKey();