下列程序执行后,其输出结果为( )。 Dim a(5) For i=0 To 4 a(i)=i+1 m=i+1 If m=3 Then a(m-1)=a(i-2)Else a(m)=a(i) If i=2 Then a(i-1)=a(m-3) a(4)=i Print a(i); Next i A: 1 1 1 4 4 B: 1 2 3 4 1 C: 1 2 1 4 4 D: 1 1 1 4 1
下列程序执行后,其输出结果为( )。 Dim a(5) For i=0 To 4 a(i)=i+1 m=i+1 If m=3 Then a(m-1)=a(i-2)Else a(m)=a(i) If i=2 Then a(i-1)=a(m-3) a(4)=i Print a(i); Next i A: 1 1 1 4 4 B: 1 2 3 4 1 C: 1 2 1 4 4 D: 1 1 1 4 1
若排列38i7j625为奇排列,则i=( ),j=( ). A: i=1,j=4 B: i=4,j=1 C: i=4,j=9 D: i=9,j=4
若排列38i7j625为奇排列,则i=( ),j=( ). A: i=1,j=4 B: i=4,j=1 C: i=4,j=9 D: i=9,j=4
以下程序的运行结果是 Sub s1(b() As Integer) For i = 1 To 4 b(i) = 2 * i Next i End Sub Private Sub Command1_Click() Dim a(1 To 4) As Integer For i = 1 To 4 a(i) = i + 5 Next i s1 a() For i = 1 To 4 Print a(i) Next i End Sub
以下程序的运行结果是 Sub s1(b() As Integer) For i = 1 To 4 b(i) = 2 * i Next i End Sub Private Sub Command1_Click() Dim a(1 To 4) As Integer For i = 1 To 4 a(i) = i + 5 Next i s1 a() For i = 1 To 4 Print a(i) Next i End Sub
下列代码段执行后的结果是()int[] a = { 1, 3, 5, 2, 4 };int j = 4;for (int i = 0; i <; 5; i++) { a[i] = a[j]; j--;}for (int i = 0; i <; 5; i++) System.out.print(a[i] + " ");[/i][/i] A: 1 2 3 4 5 B: 5 4 3 2 1 C: 4 2 5 2 4 D: 4 2 5 3 1
下列代码段执行后的结果是()int[] a = { 1, 3, 5, 2, 4 };int j = 4;for (int i = 0; i <; 5; i++) { a[i] = a[j]; j--;}for (int i = 0; i <; 5; i++) System.out.print(a[i] + " ");[/i][/i] A: 1 2 3 4 5 B: 5 4 3 2 1 C: 4 2 5 2 4 D: 4 2 5 3 1
d={i:str(i) for i in range(1, 5)},d的值是()。 A: {1: 1, 2: 2, 3: 3, 4: 4} B: {1: '1', 2: '2', 3: '3', 4: '4'} C: {1,2,3,4} D: 以上都不对
d={i:str(i) for i in range(1, 5)},d的值是()。 A: {1: 1, 2: 2, 3: 3, 4: 4} B: {1: '1', 2: '2', 3: '3', 4: '4'} C: {1,2,3,4} D: 以上都不对
产生并输出如下形式的方阵。 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
Public Sub Proc(a%( )) Static i% Do a(i) = a(i) + a(i + 1) i = i + 1 Loop While i < 2 End Sub Private Sub Command1_Click( ) Dim m%, i%, x%(10) For i = 0 To 4: x(i) = i + 1: Next i For i = 1 To 2: Call Proc(x): Next i For i = 0 To 4: Print x(i);: Next i End Sub A: 3 4 7 5 6 B: 3 5 7 4 5 C: 2 3 4 4 5 D: 4 5 6 7 8
Public Sub Proc(a%( )) Static i% Do a(i) = a(i) + a(i + 1) i = i + 1 Loop While i < 2 End Sub Private Sub Command1_Click( ) Dim m%, i%, x%(10) For i = 0 To 4: x(i) = i + 1: Next i For i = 1 To 2: Call Proc(x): Next i For i = 0 To 4: Print x(i);: Next i End Sub A: 3 4 7 5 6 B: 3 5 7 4 5 C: 2 3 4 4 5 D: 4 5 6 7 8
for(i=4;i>1;i--)for(j=1;j
for(i=4;i>1;i--)for(j=1;j
【单选题】某多级减速器各级速比i 1 =2、i 2 =3、i 3 =4、i 4 =3,则总速比()。 A. i=i 1 +i 2 +i 3 +i 4 =12 B. i=i 1 ×i 2 ×i 3 ×i 4 =72 C. i=3(i 1 +i 2 +i 3 )=48 D. 不能求得
【单选题】某多级减速器各级速比i 1 =2、i 2 =3、i 3 =4、i 4 =3,则总速比()。 A. i=i 1 +i 2 +i 3 +i 4 =12 B. i=i 1 ×i 2 ×i 3 ×i 4 =72 C. i=3(i 1 +i 2 +i 3 )=48 D. 不能求得
以下代码的执行结果是( )。for i in range(4): print(2**i,end = " ") A: 1 2 4 8 B: 2 4 8 16 C: 1 2 4 8 16 D: 1 2 4
以下代码的执行结果是( )。for i in range(4): print(2**i,end = " ") A: 1 2 4 8 B: 2 4 8 16 C: 1 2 4 8 16 D: 1 2 4