Skip to content
本站總訪問量
本站訪客數 人次

TQC+ 程式語言Python 203 閏年判斷

題目說明:請使用選擇敘述撰寫一程式,讓使用者輸入一個西元年份,然後判斷它是否為閏年(leap year)或平年。其判斷規則為:每四年一閏,每百年不閏,但每四百年也一閏。

範例輸入1

shell
1992

範例輸出1

shell
1992 is a leap year.

範例輸入2

shell
2010

範例輸出2

shell
2010 is not a leap year.

Contributors

The avatar of contributor named as lucashsu95 lucashsu95

Changelog