> 其他 >
闰年是指能被4整除但不能被100整除,或者能被400整除的年份编写一个程序,判断输入的年份是否为闰年
要用INPUT```
TF THEN```
PRINT```
格 式的
谁知道 麻烦速度打下
人气:129 ℃ 时间:2020-01-20 23:49:20
解答
input a
if ((a mod 4)=0 and (a mod 100)>0)or (a mod 400)=0 then
print "是闰年"
else
print "不是闰年"mod是什么mod 是求余数,即 4 mod 4=0;5 mod 4 =1,
推荐
猜你喜欢
© 2025 79432.Com All Rights Reserved.
电脑版|手机版