> 其他 >
vf命令计算出1-50以内能被3和5整除的数之和
求大神指导这个程序哪里出错了?
clear
set talk off
x=0
y=1
do while not eof()
x=x+1
do case
case mod(x,5)=0 or mod(x,3)=0
y=y+x
case x50
exit
endcase
enddo
?y
人气:195 ℃ 时间:2020-04-16 10:06:00
解答
clearset talk offx=0y=0 &&原来y=1do while not eof()x=x+1do casecase mod(x,5)=0 and mod(x,3)=0 &&原来case mod(x,5)=0 or mod(x,3)=0y=y+xcase x50exitendcaseenddo
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版