下列程序段执行以后,内存变量Y的值是()CLEARX=12345Y=0DO WHILE X>0Y=Y+X%10X=INT(X/10)ENDDOA.54321 B.12345 C.51 D.15
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/06 11:51:49
![下列程序段执行以后,内存变量Y的值是()CLEARX=12345Y=0DO WHILE X>0Y=Y+X%10X=INT(X/10)ENDDOA.54321 B.12345 C.51 D.15](/uploads/image/z/6900374-38-4.jpg?t=%E4%B8%8B%E5%88%97%E7%A8%8B%E5%BA%8F%E6%AE%B5%E6%89%A7%E8%A1%8C%E4%BB%A5%E5%90%8E%2C%E5%86%85%E5%AD%98%E5%8F%98%E9%87%8FY%E7%9A%84%E5%80%BC%E6%98%AF%EF%BC%88%EF%BC%89CLEARX%3D12345Y%3D0DO+WHILE+X%3E0Y%3DY%2BX%2510X%3DINT%28X%2F10%29ENDDOA.54321+B.12345+C.51+D.15)
x){i+n/<ٽ>mOx?e{Y-O<{:}\"l
ML#m
\=<}\""m##T
"l=B4"
4]\\LML
\MmvX35`I`6]`qP :np;XfID=}׳KMVt}6u,Lblv4<[ndd.:@u>L=l S-xa#0(LLk o{>sMN\do_\g
q |&$0
下列程序段执行以后,内存变量Y的值是()CLEARX=12345Y=0DO WHILE X>0Y=Y+X%10X=INT(X/10)ENDDOA.54321 B.12345 C.51 D.15
下列程序段执行以后,内存变量Y的值是()
CLEAR
X=12345
Y=0
DO WHILE X>0
Y=Y+X%10
X=INT(X/10)
ENDDO
A.54321 B.12345 C.51 D.15
下列程序段执行以后,内存变量Y的值是()CLEARX=12345Y=0DO WHILE X>0Y=Y+X%10X=INT(X/10)ENDDOA.54321 B.12345 C.51 D.15
X=12345
Y=0
DO WHILE X>0
Y=Y+X%10(X%10取出此时x的个位数)
X=INT(X/10)进行一次之后依次变为 1234,123,12,1
ENDDO
?Y
所以答案就是5 4 3 2 1 相加为15
明白没呢?