执行下列的程序段后,结果为______。 i = 0 n = 0 Do While i < 32 i = (i + 1) * (i + 1) n = n + 1 Loop Print nA.29B.4C.3D.0

执行下列的程序段后,结果为______。 i = 0 n = 0 Do While i < 32 i = (i + 1) * (i + 1) n = n + 1 Loop Print n

A.29

B.4

C.3

D.0


参考答案和解析
C

相关考题:

以下程序运行后的输出结果是【】。main(){int i,n[]={0,0,0,0,0}; for(i=1;i=4;i++) { n[i]=n[i-1]*2+1; printf("%d",n[i]); }}

以下程序运行后的输出结果是【9】。includestdio.hmain(){ int i,n[]={0,0,0,0,0};for(i=1;i=2;i++){ n[i]=n[i-1]*3+1;printf("%d",n[i]);}printf("\n");}

以下程序的输出结果是 ______。 Dim n(2,2), i, j As Integer For i = 0 To 2 For j = 0 To 2 n(i,j) = i + j Next j Next i For i = 0 To 1 For j = 0 To 1 n(i+ 1 ,j + 1) = n(i + 1,j + 1) + n(i, j) Next j Next i Print n(i, j)A.14B.0C.6D.值不确定

(12)下列程序段的运行结果是 Sub sele() Dim n As Integer I=21:n=3 Do While in I=i-n Loop Print i End SubA.2 B.4 C.5 D.3

程序段s=i=0;do{i=i+1;s=s+i;}while(i=n);的时间复杂度为()。A、O(n)B、O(nlog2n)C、O(n)D、O(n/2)

有以下程序 main ( ) { int i,n=0; for (i=2 ;i<5;i++) { do { if (i%3) continue; n++; } while(!i); n++; } print f ( "n=%d\n" , n); } 程序执行后的输出结果是A.n=5B.n=2C.n=3D.n=4

以下程序的执行结果是【】。 include include void pnnt(int n) { if (n!=0 以下程序的执行结果是【 】。include<iostream.h>include<iomanip.h>void pnnt(int n){if (n!=0){Print(n-1);for (int i=1;i<=n;i++)cout<<setw(3)<<i;cout<<endl;}}void main(){print(4);}

以下能够正确计算n!的程序是A.Private Sub Command1_Chck( ) n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<=n Print x End SubD.Private Sub Command1_Click( ) n=5:x=1:i=l Dox=x*i i=i+1 Loop While i>n Print x End Sub

以下程序的执行结果是______ include include void print(int n) { if(n 以下程序的执行结果是______include<iostream.h>include<iomanip.h>void print(int n){if(n!=0){print(n-1);for(int i=1;i<=n;i++=cout<<setw(3)<<i;cout<<endl;}}void main(){print (4);}

以下能够正确计算n!的程序是A.Private Sub Command1 Click() n=5:x=1 Do x=x * I I=I + 1 Loop While I < n Print x End SubB.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End SubC.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End SubD.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

下列程序段的运行结果是:Private Sub Command1_Click() Dim n AS Integer I =21: n = 3 do while I>n I=I- n Loop Print IEnd Sub在窗体上打印的结果是______。A.3B.5C.6D.8

阅读以下说明和C语言程序,将应填入(n)处的字句写在对应栏内。【说明】计算n的合数。一个整数n可以有多种划分,使其划分的一列整数之和为n。例如,整数5的划分为:54 13 23 1 12 2 12 1 1 11 1 1 1 1共有7种划分。这种划分的程序如下所示。【程序】include <stdio.h>int n[1000],m,k;void output sum(){int j;for(j=0;n[j]!=0;j++)printf("%d\t",n[j]);printf("\n");}void sum(int i)if(m-n[i]<n[i]){ m=m-n[i];(1)i++;n[i+1]=0;}else{(2)m-=n[i];i++;}if(m!=n[i])sum(i);elseoutput_sum();if(n[i]>1){n[i]--;(3)}else{while((n[i]==1)(i>O)){i--;(4)}if(i!=0){(5)sum(i);}}}void main(){int i;scanf("%d",n[0]);m=k=n[0];for(i=1;i<=k;i++)n[i]=0;while(n[0]!=1){n[0]--;i=0;sum(0);m=k;}}

以下能够正确计算n! 的程序是( )。A.Private Sub Command1_Click( ) n=5:x=l Do x=x*i i=i+1 Loop While i < n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i < n Print x End SubC.Private Sub Command1_Cliek( ) n:5:x=1:i=1 Do x=x* i i:i+1 Loop While i < = n Print x End SubD.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

下列程序段的运行结果是( )。 Subsele() Dim n As Integer i=21:n=3 Do While i>n i=i-n Loop Print i End SubA.2B.4C.5D.3

下列不构成无限循环的语句或语句组是( )。A.n=0; do{++n;)while(n=0);B.n=0; while(1){n++;)C.while(n=1O);{n--;}D.for(n=0,i=1;;i++)n+=i

下列不构成无限循环的语句或语句组是( )。A.n=0; do {++n;} while (n<=0);B.n=0; while (1) {n++;}C.n=10; While (n); {n--;}D.for(n=0, i=1; ;i++)n+=i

有以下程序includestdio.hmain( ){int i,n[]=(0,0,0,0,0);for(i=1;i=4;i++){n[i]=n[i-1]*3+1;printf(”%d”,n[i]));}}程序运行后的输出结果是______。

以下能够正确计算n!的程序是A.Privas Sub Command1_Click() n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop while i<=n Print x End SubD.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

下列程序段的执行结果为 n=0 For i=1 To 3 For j=5 To 1 Step-1 n=n+1 Next j,i Print n;j;iA.12 0 4B.15 0 4C.12 3 1D.15 3 1

单击命令按钮后,下列程序代码的执行结果是______。Public Sub fun (a As Integer, b As Integer, c As Integer)Doa=b+ cn=n+1Loop While n > 3End SubPrivate Sub command1_ click()Dim m As Integer, n As Integer, i As IntegerFor i = 0 To 2: m = n + 1: Next iFor i = 1 To 2: Call fun (m, n, i): Next iFor i = 0 To 3Print m;Next iEnd Sub

下列程序段的运行结果是( )。 Sub sele() Dim n As Integer i=21: n=3 Do While i > n i=i-n Loop Print i End SubA.2B.4C.5D.3

以下能够正确计算n!的程序是______。A.Private Sub Commeadl_Click() n=5: x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop Whilei<=n Print x End SubD.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

以下能够正确计算n!的程序是( )。A.Pfivate Sub Commgld1_LClick() n=5:x=1 Do x=x*1 i=i+1 Loop Whilei<nB.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*1 i=i+1 Loop Whilei<n Print x End SubC.Pfivate Sub Command1_ C1ick() n=5:x=1:i=1 Do X=X*1 i=i+1 Loop While i<=nD.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

有以下程序:include main(){ int i,n=0;for(i=2;i 有以下程序: #include <stdio.h> main() { int i,n=0; for(i=2;i<5;i++) { do { if(i%3) continue; n++; } while(! i); n++; } printf("n=%d\n",n); } 程序执行后的输出结果是( )。A.n=5B.n=2C.n=3D.n=4

以下能够正确计算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 SubC.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

有以下程序 main() { int i,n=0; for(i=2;i<5;i++) { do {if(i%3)continue; n++; }while(!i); n++; } printf("n=%d\n",n); } 程序执行后输出结果是A.n=5B.n=2C.n=3D.n=4

以下不会构成无限循环的语句或语句组是()A、n=0;do{++n;}while(n=0)B、n=0;while(1){n++;}C、n=10;while(n);{n--;}D、for(n=0,i=1;;i++)n+=i

单选题以下不构成无限循环的语句或者语句组是(  )。An=0;do{++n;}while(n=0);Bn=0;while(1){n++;}Cn=10;while(n);{n--;}Dfor(n=0,i=1;i++)n+=i;