> 数学 >
求1000到9999之间所有回文数的个数
人气:244 ℃ 时间:2019-09-05 20:34:13
解答
set talk off
clear
n=0
for x=1000 to 9999
a=int(x/1000)
b=int((x-a*1000)/100)
c=int((x-a*1000-b*100)/10)
d=mod(x,10)
if a=d and b=c and mod(x,6)=0
n=n+1
endif
endfor
set talk on
return
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版