执行下列程序,最后S的显示值为( )。 SET TALK OFF s=0 i=2 x=10 DO WHILE s<=x s=s+i i=i+1 ENDDO ?s SET TALK ONA.12B.14C.16D.18
执行下列程序,最后S的显示值为( )。 SET TALK OFF s=0 i=2 x=10 DO WHILE s<=x s=s+i i=i+1 ENDDO ?s SET TALK ON
A.12
B.14
C.16
D.18
相关考题:
填上适当的语句,使求100以内能被3整除但不能被7整除的数字之和的程序完整正确。SET TALK OFFCLEARSTORE O TO S,NDO WHILE N=i00【 】S=S+NENDIF【 】ENDDO?“S=”+STR(S)SET TALK 0N
【程序说明】 求1~10之间的所有整数之和。【程序】SET TALK OFFSTORE 0 TO N,SDO WHILE (1)N=N+1S=S+NIF (2)(3)ENDIFENDDO? “ S=”+STR (S,2)SET TALK ONRETURN(1)A..F.B..T.C.N<=10D.N>=10
【程序说明】程序功能是求1!+2!+3!+…+10!的累加和。【程序】SET TALK OFFS=0FOR i=1 TO 10t=1FOR j=1 TO (5)t=t*j(6)s=s+ tNEXT(7)SET TALK ON(5)A.10B.jC.9D.i
执行下列程序:SET TALK OFFSTORE 0 TO X,YDO WHILE X<6X=X+YY=Y+2ENDDO? X,YSET TALK ONRETURN在屏幕上显示的输出结果是( )。A.88B.68C.46D.66
阅读下列程序,并给出运行结果SET,FALK OFFCLEARSTORE 0 T0 X,Y,S1,S2,S3D0 WHILE X1OX=X +lDO CASECASE INT(X/2)=X/2S1:SI+X/2CASE MOD(XJ 3)=0S2=S2+X/3CASE INT(X/2)X/2S3=S3+1ENDCASEENDDO?S1,S2,S3SET TALK 0NRETURN运行以上程序后,屏幕显示【 】。
【程序说明】 计算1~30之间能够被3整除的奇数的阶乘和。【程序】** 主程序SET TALK OFFS=0FOR I=1 TO 30 STEP 2IF (4)(5)S=S+NENDIFENDFOR?“1到30之间能被3整除的奇数阶乘和为:”+ (6)SET TALK ONRETURN** 过程 P1.PRGPARAMETERS M(7)N=1FOR J=1 TO MN=N*JENDFOR(8)(4)A.MOD(I,3)=0B.MOD(I,3)>0C.MOD(I,3)<>0D.MOD(I,3)=0
【程序】SET TALK OFFS=0I=1DO WHILE I<4ACCEPT “请输入字符串:”TO XIF“A” $ XS=S+1ENDIFI=I+1 ENDDO? SRETURN运行时输入:“abcd”、“aBCD”,输出S的值为 ______。A.3B.2C.1D.0
执行下列程序,最后S的显示值为( )。SET TALK OFFs=0i=2x=10DO WHILE s<=xs=s+ii=i+1ENDDO?sSET TALK ONA.12B.14C.16D.18
用程序计算一个整数的各位数字之和,在下划线处应填写的语句是( )。SET TALK OFFINPUT "X=" TO XS=0DO WHILE X! =0S=S+MOD(X, 10)ENDDO?sSET TALK ONA.X=int(X/10)B.X=int(X%10)C.X=X-int(X/10)D.X=X-int(X%10)
执行如下程序,最后S的显示值为 SET TALK OFF S=0 i=5 X=11 DO WHILE S<=x S=S +i I = I +l ENDDO ?s SET TALK ONA.5B.11C.18D.26
【程序】SET TALK OFFCLEARSTORE 0 TO X,S1,S2,S3DO WHILE X<15X=X+1DO CASECASEINT(X/2)=X/2S1=S1+X/2CASE MOD(X,3)=0S2=S2+X/3CASE INT(X/2)<>X/2S3=S3+1ENDCASEENDDO? X,S1,S2,S3SET TALK ONRETURNX的输出结果为 ______。A.0B.14C.15D.16
执行如下程序,最后S的显示值为( )。 SET TALK OFF s=0 i=2 x=10 DO WHILE s一一X S=S+i i=i十l ENDDO ?S SET TALK ONA.12B.14C.16D.18
执行如下程序,则最后S的显示值为( )。 SET TALK FFS=0 i=5x=11DO WHILE s=X s=s+ii=i+lENDD07 S SET TALK ONA. 5B. 11C. 18D. 26
执行如下程序,最后s的显示值为 SET TALK OFF S=0 i=5 x=11 DO WHILE s=x s=s+i i=i+l ENDD0 7 S SET TALK ONA. 5B. 11C. 18D. 26
下列程序的运行结果是 SET TALK OFF STORE 0 TO S N=20 DO WHILE N>S S=S+N N=N-2 ENDDO ?S RETURNA.0B.2C.20D.18
【程序说明】程序功能是计算一个整数的各位数字之和。【程序】SET TALK OFFINPUT“x=”TO xs=0DO WHILE x!=0s=s+ MOD(x,10)(1)(2)? SSET TALK ON(1)A.x=INT(x*10)B.x=INT(x/10)C.x=x-INT(x/10)D.x=x-INT(x*10)
若s、i均为整型变量,执行下列程序段后s的值为 ______。s=0i=1Dos=s+ii=i+1Loop Until i>5@答案@15@[评析]@本题考查了Do...Loop Until控制语句。每执行一次循环,变量s加一次变量i,随后变量i再加一次1,直到变量5大于5时终止循环。i的初始值为1,故Do循环执行5次。相应的,变量s分别加1、2、3、4、5,故答案为15。
执行下列程序后,变量s的值是( )。SET TALK OFFCLEARx=〝l2345〞s=〝〞1=LEN(x)DO WHILE l>;1x1=SUBSTR(x,1-1,2)s=s+x11=l-2ENDD0?sA.2345B.4523C.54321D.45231
执行如下程序SET TALK OFFS=0I=1INPUT "N=" TO NDO WHILE S 执行如下程序SET TALK OFFS=0I=1INPUT "N=" TO NDO WHILE SS=S+II=I+1ENDDO?SSET TALK ON如果输入值为5,则最后S的显示值是( )。A.1B.3C.5D.6
执行如下程序,最后S的显示值为 SET TALK OFF S=0 i=5 X=11 DO WHILE s<=X s=s+i i=i+1 ENDDO ?s SET TALK ONA.5B.11C.18D.26
单选题以下是表单的Activate事件的代码: s=0 n=10 do while n0 s=s+n n=n-2 enddo this.text1.value=s 这段代码执行后,文本框Text1的值为()A0B10C30D40