以下能够正确计算n!的程序是( )。
A.Pfivate Sub Commgld1_LClick() n=5:x=1 Do x=x*1 i=i+1 Loop Whilei<n
B.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*1 i=i+1 Loop Whilei<n Print x End Sub
C.Pfivate Sub Command1_ C1ick() n=5:x=1:i=1 Do X=X*1 i=i+1 Loop While i<=n
D.Private Sub Command1_C1ick() n=5:x=1:i=1 Do X=X*1 i=i+1 Loop While i>n Print x End Sub
第1题:
以下能够正确计算n!的程序是( )。
A.Private Sub Commandl_C1ick()
B.hiVate Sub Commandl_C1ick() n=5:x=1 n=5:x=1:i=1 DO DO X=x*1 X=X*1 i=i+1 i=i+1 Loop while i<n Loop While<n Print x Ptinte x End Sub End Sub
C.Private Sub Commandl_Click ()
D.Pdvate Sub Commandl C1ick() n=5:X=1:i=1 n=5=:x=1:i=1 DO DO X=X*1 X=X*1 i=i+1 i=i+1 Loop While i>n Print x Print x End Sub End Sub
第2题:
以下能够正确计算n!的程序是______。
A.Private Sub Commeadl_Click() n=5: x=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
B.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
C.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop Whilei<=n Print x End Sub
D.Private Sub Commsndl_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub
第3题:
以下能够正确计算n!的程序是
A.Private Sub Command1_Click( ) n=5: x=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
B.Private Sub Command1_Click( ) n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
C.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i<= n Print x End Sub
D.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub
第4题:
以下能够正确计算n!的程序是
A.Privas Sub Command1_Click() n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
B.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
C.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop while i<=n Print x End Sub
D.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub
第5题:
以下能够正确计算n! 的程序是( )。
A.Private Sub Command1_Click( ) n=5:x=l Do x=x*i i=i+1 Loop While i < n Print x End Sub
B.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i < n Print x End Sub
C.Private Sub Command1_Cliek( ) n:5:x=1:i=1 Do x=x* i i:i+1 Loop While i < = n Print x End Sub
D.Private Sub Command1_Cliek( ) n=5:x:1:i=1 Do x=x*i i=j+1 Loop While i > n Print x End Sub
第6题:
以下能够正确计算n!的程序是
A.Private Sub Command1 Click() n=5:x=1 Do x=x * I I=I + 1 Loop While I < n Print x End Sub
B.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End Sub
C.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End Sub
D.Private Sub Command1_Click() n=5:X=1:I=1 Do x=x * I I=I + 1 Loop While I>n Print X End Sub
第7题:
以下能够正确计算n!的程序是
A.Private Sub Command1_Chck( ) n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
B.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<n Print x End Sub
C.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<=n Print x End Sub
D.Private Sub Command1_Click( ) n=5:x=1:i=l Dox=x*i i=i+1 Loop While i>n Print x End Sub
第8题:
假如整数数列中的数不重复,并存放在数组中。下列给定的程序中,函数fun()的功能是:删除数列中值为X的元素。 N中存放的是数列中元素的个数。
请改正程序中的错误,使它能够得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
include<stdio.h>
define N 20
fun (int *a,int n,int x)
{int p=0,i;
a[n]=x;
while (x!=a[p])
p=p+1;
if(p==n) return -1;
else
{for (i=p;i<n;i++)
/*************found**************/
a[i+1]=a[i];
return n-1;
}
}
main()
{int w[N]={-3,0,1,5,7,99,10,15,30,90},
x,n,i;
n=10;
printf("The original data :\n");
for (i=0;i<n;i++) printf("%5d",w[i]);
printf("\nInput x (to delete ): ");
scanf("%d",&x);
printf("Delete : %d\n",x);
n=fun(w,n,x);
if (n==-1) printf("***No be found!
***\n\n");
else
{printf("The data after deleted:\n");
for (i=0;i<n;i++) printf("%5d",
w[i]);printf("\n\n");
}
}
第9题:
以下能够正确计算n!的程序是( )。
A.Private Sub Command1_Click()
n=5: x=1
Do
x=x * I
I=I + 1
Loop While I < n
Print x
End Sub
B.Private Sub Command1_Click()
n=5: x=1: I=1
Do
x=x * I
I=I + 1
Loop While I < n
Print x
End Sub
C.Private Sub Command1_Click()
n=5: x=1: I=1
Do
x=x * I
I=I + 1
Loop While I <=n
Print x
End Sub
D.Private Sub Command1_Click()
n=5: x=1: I=1
Do
x=x * I
I=I + 1
Loop While I > n
Print x
End Sub