网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下面的程序计算的数学式是_______。 T=1 S=0 For I=1 to 19 step 2 T=T*I S=S+T Next I Print S
A.1!+3!+5!+...+19!
B.1*3*5*...*19
C.1+1*3+1*3*5+...+1*3*5*...19
D.1+3+5+...+19
参考答案和解析
2500
更多 “下面的程序计算的数学式是_______。 T=1 S=0 For I=1 to 19 step 2 T=T*I S=S+T Next I Print SA.1!+3!+5!+...+19!B.1*3*5*...*19C.1+1*3+1*3*5+...+1*3*5*...19D.1+3+5+...+19” 相关考题
考题
以下程序求1!+2!+3!+…+10!的累加和,请为下面的程序选择正确的答案 s=0 FOR i=1 TO 1 0 t=1 FOR j=1 TO____t=t*jNEXTs=s+tNEXT? SA) 10 B)j C)9 D)i
考题
下列给定程序中,函数p roc的功能是:先将字符串s 中的字符按顺序存放到t中,然后把S中的字符按正序连接到t的后面。例如,当s中的字符串为WXYZ时,则t中的字符串应为WXYZWXYZ。 请改正程序中的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。 试题程序: includestdlib.h includeconio.h includestdio.h includestring.h void proc(char*s,char*t) { int i,s1; s1=strlen(s); for(i=0;is1;i++) //****found**** t[i]=s[s1]; for(i=0;is1;i++) t[s1+i]一s[i]; t[2*s1]=\O0; } void main { char s[100],t[100]; system("CLS"); print{("\nPlease enter string s:"); scanf("%s",s); proc(s,t); printf("The result is:%s\n",t); }
考题
有以下程序inclUdevoidfun(int*s,intn1,intn2){inti,j,t;i=n1;j=n2;while(i
有以下程序 #inclUde <stdio.h> void fun(int *s,int n1,int n2) { int i,j,t; i=n1; j=n2; while(i<j) {t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4A.0987654321B.4321098765C.5678901234D.0987651234
考题
已知程序段 S=0 For i=1 To 10 step 2 S=S+1 i=i*2 Next i 当循环结束后,变量i,s的值分别为( )。A.10,6B.11,4C.22,3D.16,5
考题
(14)有下列程序,程序运行后单击命令按钮,则输出的结果是 Private Sub Command1_Click() Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2# For i=1 To 4 a(i)=i Next i For i=3 To 6 b(i)=i Next i s1=Factorial(a) S2=Factorial(b) Print"s1=";s1;"s2";s2; End Sub Function Factorial(a()As Integer) Dim t#,i% t=1 For i=LBound(a) To UBound(a) t=t*a(i) Next i Factorial=t End Factorial A.s1=360 s2=24 B.s1=24 s2=360 C.s1=24 s2=24 D.s1=360 s2=360
考题
下面运行程序后,单击命令按钮,输出的结果是 【 】 。Private Sub Command1_Click()Dim a%(1 To 5),i%, s#For i=1 To 5a(i)=iNexts=Fun(a)Print "s="; s;End SubFunction Fun(a() As Integer)Dim t#, i%t=1For i=LBound(a) To UBound(a)t=t a(i)NextFun=tEnd Function
考题
已知程序段: s=0 For i=0 to 10 step 2 S=S+1 i=i*2 Next i 当循环结束后,变量i、s值分别为( )。A.22,3B.11,4C.10,5D.16, 6
考题
有下列程序:main{int i,s=0,t[]={1,2,3,4,5,6,7,8,9};for(i=0;i9;i+=2)s+=*(t+i);printf(9;i+=2)s+=*(t+i);printf(%d\n,s);}程序执行后的输出结果是( )。A.A.45B.20C.25D.36
考题
下面程序的运行结果是( )。include define SlZE 12 main() {char s[SIZE];int i;for(i=0
下面程序的运行结果是( )。include<stdio.h>define SlZE 12main(){char s[SIZE];int i;for(i=0;i<SIZE;i++) s[i]='A'+i+32;sub(s,5,SIZE-1);for(i=0;i<SIZE;i++)printf("%c",s[i]);printf("\n");}sub(char *a,int t1,int t2){ char ch;while(t1<t2){ ch=*(a+t1);*(a+t1)=*(a+t2);*(a+t2)=ch;t1++;t2--;}}
考题
已知程序段: S=0 FOR I = 1 T() 10 STEP 2 S=S+1 I=I.2 NEXT I当循环结束后,变量I和s的值分别为( )。A.10和2B.11和5C.16和4D.22和3
考题
现有如下程序: Private Sub Command1_Click() s=0 For i=1 To 5 s=s+f(5+i) Next Print s End Sub Public Function f(x As Integer) If x>=10 Then t=x+1 Else t=x+2 End If f=t End Function 运行程序,则窗体上显示的是( )。A.38B.49C.61D.70
考题
已知程序段: s=0 For i=1 To 10 Step 2 s=s+1 i=i*2 Next i 当循环结束后,变量i的值为______,变量s的值为______。A.10,4B.11,3C.22,3D.16,4
考题
下面运行程序后,单击命令按钮,输出出的结果是【 】。Private Sub Command1_Click( )Dim a% (1 To 5) ,i%, sFor i = 1 To 5a(i) =iNexts = Fun(a)Print"s="; s;End SubFunction Fun(a() As Integer)Dim t, i%t=1For i = LBound(A0To UBound(a)t=t * a(i)NextFun =tEnd Function
考题
若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 Private Sub Command1_Click() Dim a%(1 To 4), b%(3 To 6), i%, s1#, s2# For i= 1 To 4 a(i) = i Next i For i=3 To 6 b(i) = i Next i s1 = Factorial (A) s2 = Factorial (B) Print "s1="; s1; "s2="; s2 End Sub Function Factorial(a() As Integer) Dim t#, i% t=1 For i = LBound(A)To UBound(A) t = t * a(i) Next i Factorial = t End FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360
考题
有下列程序,程序运行后单击命令按钮,则输出的结果为( )。Private Sub Command1_Click()Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2# For i=1 To 4 a(i)=i Next i For i=3 To 6 b(i)=i Next i s1=Factorial(A) s2=Factorial(B)Print "s1=";s1;"s2=";s2End SubFunction Factorial(a()As Integer)Dim t#,i% t=1 For i=LBound(A)To UBound(A) t=t*a(i) Next i Factorial=tEnd FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360
考题
请完成下列Java程序:计算下列级数之和,直到该项之绝对值小于0.001为止。S=1/1! -1/2! +1/3! -1/4! +注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。程序运行结果如下:i=1 s=1.0i=2 s=0.5i=3 s=0.6666666666666666i=4 s=0.625i=5 s=0.6333333333333333i=6 s=0.6319444444444444public class exl3_2{public static void main(Stfing[] args){double s=0.0,sign=-1.0,t,f=1.0;for(int i=1;;i++){f=f*i;__________;t=sign/f;if(__________)break;s=s+t;System.out.prinfln("i="+i+"s="+s);}}}
考题
程序段如下: Dim i As Integer,s As Integer For i=4 To 1 Step-1 s=s+i Next i Print s,i执行的结果是( )。A.10 0B.9 1C.10 1D.9 0
考题
有下列程序,程序运行后单击命令按钮,则输出的结果是( )。Private Sub Command1_Click()Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2#For i=1 To 4a(i)=iNext iFor i=3 To 6b(i)=iNext is1=Factorial(A)s2=Factorial(B)Print"s1=";s1;"s2=";s2End SubFunction Factorial(a() As Integer)Dim t#,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)Next iFactorial=tEnd FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360
考题
下列程序段的招待结果是______ 。 s=0 t=0 u=0 For i = 1 To 3 For j = 1 To i For k = j To 3 s=s+ 1 Next k t=t+1 Next j u=u+ 1 Next i Print s; t; uA. 14 6 3B.6 14 3C.9 8 7D.8 9 10
考题
程序段: S=0 For I=1 to 5 step 2 S=s+I Next I Print I语句S=S+1执行的次数和最后I的值分别为( )。A.3,7B.2,5C.3,5D.2,7
考题
下面程序运行后输出结果是( )。 For I=1 to 2 S=1 For j=0 to I-1 S=S+S*I Next j Print S Next IA.1 1B.0 2C.2 9D.6 9
考题
程序段如下; s=0 For I=5 to -1 step -2 S=s+I Next I Print I 语句S=S+I执行的次数和最后I的值分别为( )。A.3,-1B.4,-1C.4,-3D.0, 5
考题
有以下程序:include main( ){int i,s=0,t[] = {1,2,3,4,5,6,7,8,9};for(i=0;i
有以下程序:#include <stdio.h>main( ){ int i,s=0,t[] = {1,2,3,4,5,6,7,8,9}; for(i=0;i<9;i+=2) s+=*(t+i); prinff("% d \n ",s);A.45B.20C.25D.36
考题
下面运行程序后,单击命令按钮,输出的结果是【 】。Private Sub Command1_Click()Dim a%(1 To 4),b%(3 To 6),i%,s1,s2For i=1 To 4a(i)=iNextFor i=3 To 6b(i)=iNexts1.= Fun(a)s2 =Fun(b)Print "s1 ="; s1; "s2 ="; s2End SubFunction Fun( a( ) As Integer)Dim t, i%t=1For i = LBound(A)To UBound(a)t=t * a(i)NextFun=tEnd Function
考题
下面程序运行后,单击命令按钮,输出的结果是______。Private Sub Command1_Click()Dim a%(1 To 5),i%,sFor i=1 To 5a(i) =iNexts=Fun(A)Print "s=";s;End SubFunction Fun(a() As Integer)Dim t,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)NextFun=tEnd Function
考题
填空题for(i=1,t=1,s=0;i=n;i++){t=t*i;s=s+t;}的时间复杂度为()
热门标签
最新试卷