• 2021-04-14 问题

    【单选题】以下程序的输出结果是: 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

  • 2021-04-14 问题

    输出以下4*5的矩阵。 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 #include int main() { int i,j,n=0; for(i=1;i<=4;i++) for(j=1; (1) ; j++, (2) ) { if( (3) ) printf(" "); printf("%d ",i*j); } printf(" "); return 0; }

    输出以下4*5的矩阵。 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 #include int main() { int i,j,n=0; for(i=1;i<=4;i++) for(j=1; (1) ; j++, (2) ) { if( (3) ) printf(" "); printf("%d ",i*j); } printf(" "); return 0; }

  • 2022-06-06 问题

    下面____程序段不能正确显示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

  • 2021-04-14 问题

    产生并输出如下形式的方阵。 1 2 2 2 2 2 1 3 1 2 2 2 1 4 3 3 1 2 1 4 4 3 3 3 1 4 4 4 3 3 1 5 1 4 4 3 1 5 5 5 1 4 1 5 5 5 5 5 1 #include "stdio.h" int main() { int a[7][7],i,j; for(i=0;i<7;i++) for(j=0;j<7;j++) if( (1) || i+j==6) a[i][j]=1; else if ( (2) &&i+j<6) a[i][j]=2; else if (i>j&&i+j<6) a[i][j]=3; else if (i i==j ; j==i  ii  i+j>6; j+i>6; 6

    产生并输出如下形式的方阵。 1 2 2 2 2 2 1 3 1 2 2 2 1 4 3 3 1 2 1 4 4 3 3 3 1 4 4 4 3 3 1 5 1 4 4 3 1 5 5 5 1 4 1 5 5 5 5 5 1 #include "stdio.h" int main() { int a[7][7],i,j; for(i=0;i<7;i++) for(j=0;j<7;j++) if( (1) || i+j==6) a[i][j]=1; else if ( (2) &&i+j<6) a[i][j]=2; else if (i>j&&i+j<6) a[i][j]=3; else if (i i==j ; j==i  ii  i+j>6; j+i>6; 6

  • 2022-06-06 问题

    下列程序段能且只能显示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)

  • 2022-06-06 问题

    下列程序段能分别正确显示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 &lt;= 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 &lt;= 4 n = n * j MsgBox(n) j = j + 1Loop

  • 2022-06-06 问题

    下列程序段不能正确显示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

  • 2022-05-31 问题

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

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

  • 2022-05-31 问题

    假定有以下程序段n=0for i=1 to 6 step 2 for j=4 to 1 step -1 n=n+1 next jnext i运行完毕后,n的值是______。 A: 0 B: 3 C: 4 D: 12

    假定有以下程序段n=0for i=1 to 6 step 2 for j=4 to 1 step -1 n=n+1 next jnext i运行完毕后,n的值是______。 A: 0 B: 3 C: 4 D: 12

  • 2022-05-31 问题

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

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

  • 1 2 3 4 5 6 7 8 9 10