对下面程序段的运行结果是( )。 int a[6][6],i,j; for(i=1;i<6;i++) for(j=1;j<6;j++) a[i][j]=(i/j) * (j/i); for(i=1;i<6;i++) { for(j=1;j<6;j++) printf("%2d",a[i][j]); printf("\n"); }
对下面程序段的运行结果是( )。 int a[6][6],i,j; for(i=1;i<6;i++) for(j=1;j<6;j++) a[i][j]=(i/j) * (j/i); for(i=1;i<6;i++) { for(j=1;j<6;j++) printf("%2d",a[i][j]); printf("\n"); }
下面____程序段不能正确显示1!、2!、3!、4!的值。 A: For I=1 To 4 n=1 For j=1 to I n=n*j Next j Print n Next I B: For I=1 To 4 For j=1 to I n=1 n=n*j Next j Print n Next I C: n=1 For j=1 to 4 n=n*j Print n Next j D: n=1:j=1 Do While j<=4 n=n*j Print n j=j+1Loop
下面____程序段不能正确显示1!、2!、3!、4!的值。 A: For I=1 To 4 n=1 For j=1 to I n=n*j Next j Print n Next I B: For I=1 To 4 For j=1 to I n=1 n=n*j Next j Print n Next I C: n=1 For j=1 to 4 n=n*j Print n Next j D: n=1:j=1 Do While j<=4 n=n*j Print n j=j+1Loop
下列程序段能且只能显示1!、2!、3!、4!的值的是( )。 A: For i = 1 To 4 n = 1 For j = 1 To i n = n * j Next j MsgBox(n)Next i B: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox(n)Next i C: n = 1For i = 1 To 4 For j = 1 To 4 n = n * j MsgBox(n) Next jNext i D: n = 1j = 1Do While j <= 4 n = n * j j = j + 1LoopMsgBox(n)
下列程序段能且只能显示1!、2!、3!、4!的值的是( )。 A: For i = 1 To 4 n = 1 For j = 1 To i n = n * j Next j MsgBox(n)Next i B: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox(n)Next i C: n = 1For i = 1 To 4 For j = 1 To 4 n = n * j MsgBox(n) Next jNext i D: n = 1j = 1Do While j <= 4 n = n * j j = j + 1LoopMsgBox(n)
下列程序段不能正确显示1!、2!、3!、4!的结果的是 。 A: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox( n)Next i B: Dim i%, j%, n%For i = 1 To 4 n = 1 For j = 1 To i n = n * j Next j MsgBox( n)Next i C: Dim j%, n%n = 1For j = 1 To 4 n = n * j MsgBox( n)Next j D: Dim j%, n%n = 1j = 1Do While j<=4 n=n*j MsgBox(n) j=j+1Loop E: Dim j%, n%n = 1j = 1Do n=n*j MsgBox(n) j=j+1Loop While j<=4
下列程序段不能正确显示1!、2!、3!、4!的结果的是 。 A: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox( n)Next i B: Dim i%, j%, n%For i = 1 To 4 n = 1 For j = 1 To i n = n * j Next j MsgBox( n)Next i C: Dim j%, n%n = 1For j = 1 To 4 n = n * j MsgBox( n)Next j D: Dim j%, n%n = 1j = 1Do While j<=4 n=n*j MsgBox(n) j=j+1Loop E: Dim j%, n%n = 1j = 1Do n=n*j MsgBox(n) j=j+1Loop While j<=4
下列程序段能分别正确显示1!、2!、3!、4!的值的是______。 A: For i = 1 To 4 n = 1 For j = 1 To i n = n * j MsgBox(n) Next jNext i B: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox(n)Next i C: n = 1For i = 1 To 4 For j = 1 To 4 n = n * j MsgBox(n) Next jNext i D: n = 1j = 1Do While j <= 4 n = n * j MsgBox(n) j = j + 1Loop
下列程序段能分别正确显示1!、2!、3!、4!的值的是______。 A: For i = 1 To 4 n = 1 For j = 1 To i n = n * j MsgBox(n) Next jNext i B: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox(n)Next i C: n = 1For i = 1 To 4 For j = 1 To 4 n = n * j MsgBox(n) Next jNext i D: n = 1j = 1Do While j <= 4 n = n * j MsgBox(n) j = j + 1Loop
【单选题】以下程序的输出结果是: void main() { int i,j,n,a[5]={3,4,1,2,-6}; for(i=0;i<5;i++) for(j=i+1;j<5;j++) if(a[j]<a[i]) { n=a[j];a[j]=a[i];a[i]=n; } for(i=0;i<5;i++) printf("%3d",a[i]); printf(" "); } A. 3 4 1 2 -6 B. 4 3 2 1 -6 C. -6 1 2 3 4 D. 4321-6
【单选题】以下程序的输出结果是: void main() { int i,j,n,a[5]={3,4,1,2,-6}; for(i=0;i<5;i++) for(j=i+1;j<5;j++) if(a[j]<a[i]) { n=a[j];a[j]=a[i];a[i]=n; } for(i=0;i<5;i++) printf("%3d",a[i]); printf(" "); } A. 3 4 1 2 -6 B. 4 3 2 1 -6 C. -6 1 2 3 4 D. 4321-6
下列程序完成按以下格式打印杨辉三角形的前N行: 1 1 1 1 2 1 1 3 3 11 4 6 4 1请在横线处填写适当语句,使程序完整。 PARAMETER( N = 10 ) INTEGER A( N, N ), I, J DO I = 1, N ______ END DO DO I = 3, N DO J = 2, I - 1 ______ ENDDO END DO DO I = 1, N WRITE( *, 10 )( A( I, J ), J = 1, I ) END DO10 FORMAT( 1X, 10I5 )END
下列程序完成按以下格式打印杨辉三角形的前N行: 1 1 1 1 2 1 1 3 3 11 4 6 4 1请在横线处填写适当语句,使程序完整。 PARAMETER( N = 10 ) INTEGER A( N, N ), I, J DO I = 1, N ______ END DO DO I = 3, N DO J = 2, I - 1 ______ ENDDO END DO DO I = 1, N WRITE( *, 10 )( A( I, J ), J = 1, I ) END DO10 FORMAT( 1X, 10I5 )END
执行下列程序段后,输出结果是 n = 0 For i=1 To 3 For j=5 To 1 Step -1 n = n + 1 Next j, i Debug.Print n; j; i
执行下列程序段后,输出结果是 n = 0 For i=1 To 3 For j=5 To 1 Step -1 n = n + 1 Next j, i Debug.Print n; j; i
今 天 是 。 Jīntiān shì。 ? 6 月1;号2019年;;yuè; ;hào;;; nián|;2019 年 6 月 1 号; ; ; ;;;nián; ;yuè; ;hào;;|1 号 6 月 2019 年;; ;;hào;yuè; ; ; ;nián|2019 年 1 号 6 月;; ; ;;;nián; ;hào;;yuè
今 天 是 。 Jīntiān shì。 ? 6 月1;号2019年;;yuè; ;hào;;; nián|;2019 年 6 月 1 号; ; ; ;;;nián; ;yuè; ;hào;;|1 号 6 月 2019 年;; ;;hào;yuè; ; ; ;nián|2019 年 1 号 6 月;; ; ;;;nián; ;hào;;yuè
程序段中语句x=x+y的执行的频率是( )int x,y; x=0;y=0; for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) for(int k=1;k<=j;k++) x=x+y; A: n*(n+1)*(2n+1)/6 B: n*(n+1)*(n+2)/6 C: n*(n+1)*(2n+3)/6 D: n*(n+1)*(n+4)/6
程序段中语句x=x+y的执行的频率是( )int x,y; x=0;y=0; for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) for(int k=1;k<=j;k++) x=x+y; A: n*(n+1)*(2n+1)/6 B: n*(n+1)*(n+2)/6 C: n*(n+1)*(2n+3)/6 D: n*(n+1)*(n+4)/6