vf命令计算出1-50以内能被3和5整除的数之和求大神指导这个程序哪里出错了?clearset talk offx=0y=1do while not eof()x=x+1do casecase mod(x,5)=0 or mod(x,3)=0y=y+xcase x50exitendcaseenddo?y

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 01:50:54

vf命令计算出1-50以内能被3和5整除的数之和求大神指导这个程序哪里出错了?clearset talk offx=0y=1do while not eof()x=x+1do casecase mod(x,5)=0 or mod(x,3)=0y=y+xcase x50exitendcaseenddo?y
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

vf命令计算出1-50以内能被3和5整除的数之和求大神指导这个程序哪里出错了?clearset talk offx=0y=1do while not eof()x=x+1do casecase mod(x,5)=0 or mod(x,3)=0y=y+xcase x50exitendcaseenddo?y
clear
set talk off
x=0
y=0 &&原来y=1
do while not eof()
x=x+1
do case
case mod(x,5)=0 and mod(x,3)=0 &&原来case mod(x,5)=0 or mod(x,3)=0
y=y+x
case x50
exit
endcase
enddo