更多"运行下列程序段,结果是______。 For m=10 to 1 s"的相关试题:
[单项选择]运行下列程序段,结果是______。
For m=10 to 1 step 0
k=k+3
Next m
A. 形成死循环
B. 循环体不执行即结束循环
C. 出现语法错误
D. 循环体执行一次后结束循环
[填空题]下面程序段的运行结果是 【15】 。
Option Base 1
Private Sub Swap (a( ) As Integ
For I=1 to 10/2
t=a(I)
a(I)=a(10-I+1)
a(10-I+1)=t
Next I
End Sub
Private Sub Form_Click( )
Dim x(10) As Integer
For I=1 to 10
x(I)=I*2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【15】 。
Option Base 1
Private Sub Swap (a( ) As Integ
For I=1 to 10/2
t=a(I)
a(I)=a(10-I+1)
a(10-I+1)=t
Next I
End Sub
Private Sub Form_Click( )
Dim x(10) As Integer
For I=1 to 10
x(I)=I*2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【14】 。
Option Base 1
Private Sub swap(a( ) As Integer)
For I = 1 to 10/2
t =a(I)
a(I) = a(10-I+l)
a(10-I+1) = t
Next I
End Sub
Private Sub Form Click( )
Dim x(10) As Integer
For I = 1 to 10
x(I) = I * 2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【14】 。
Option Base 1
Private Sub swap(a( ) As Integer)
For I = 1 to 10/2
t =a(I)
a(I) = a(10-I+l)
a(10-I+1) = t
Next I
End Sub
Private Sub Form Click( )
Dim x(10) As Integer
For I = 1 to 10
x(I) = I * 2
Next I
Swap x( )
For I=1 to 10
Print x(I)
Next I
End Sub
[填空题]下面程序段的运行结果是 【14】 。
Option Base 1
Private Sub swap(a( )As InteSer)
For I=1 to 10/2
t=a(i)
a(i)=a(10-1+1)
a(10-1+1)=t
Next1
End Sub
Private Sub Form_Click( )
Dim x(10)As Integer
For I=1 to 10
x(i)=I*2
Next1
Swap x( )
For1=1 to 10
Print x (i)
Next I
End Sub
[填空题]下面的程序段的,运行结果是______。
int c=6;
void test(x,y)
int*x,y;
{ *x=3*(*x);y=*x+y;c=y%(*x);
printf("x=%d,y=%d,c=%d/n",*x,y,c);
}
main( )
{ int a=1,b=4;
test (&a,b);
printf("a=%d,b=%d,c=%d/n",a,b,c)
}
[单项选择]下面程序段,运行后的结果是( )。
Private Sub Commandl_Click( )
Dim b%(1 To 4),i%,t#
For i=1 To 4
b(i)=i
Next i
t=Tof(b( ) )
Print"t=";t,
End Sub
Function Tof(a( ) As Integer)
Dim t#,i%
t=1
For i=2 To UBound(a)
t=t * a(i)
Next i
Tof=t
End Function
A. t=18
B. t=24
C. t=30
D. t=32
[单项选择]下面程序段,运行后的结果是
Private Sub Command1_Click( )
Dim b%(1 To 4),i%,t#
For i=1 To 4
b(i) =i
Next
t=Tof(b( ) )
Print"t=";t,
End Sub
Function Tof(a( ) As Integer)
Dim t#,i%
t=1
For i=2 To UBound(
[单项选择]下面程序段,运行后的结果是 Private Sub Command1_Click( ) Dim b%(1 To 4) ,i%, t# For i = 1 To 4 b(i) =i Next t =Tof(b( ) ) Print "t ="; t, End Sub Function Tof(a( ) As Integer) Dim t#, i% t=1 For i =2 To UBound(a) t=t * a(i) Next Tof = t End Function
A. t=18
B. t=24
C. t=30
D. t=32
[填空题]下面程序段的输出结果是 【7】 。
For X=1.5 To 5 Step 1.5
Print X;
Next X
[填空题]下面程序段的输出结果是 【7】 。
For X=1.5 To 5 Step 1.5
Print X;
Next X
[填空题]下列程序段的运行结果是______。
Dimnum As Integer,a As Integer,b As Integer
a=88:b=24
Do
While b<>0
num=a Modb
a=b
b=num
Wend
Printa
Loop
[单项选择]下面程序段的运行结果是
void main ( )
int t, a, b, C;
a=1;b=2;C=2;
while(a<b<c)
t=a;a=b;b=t;c--;
cout < < a < < "," < < b < < "," < < C;
A) 1,2,0 B) 2,1,0 C) 1,2,1 D) 2,1,1
[填空题]下列程序段的运行结果是______。
Sub sele( )
Dimn as Integer
i=21:n=3
DoWhilei>n
i=i-n
Loop
Printi
End Sub