试题 试卷
题型:单选题 题类:常考题 难易度:容易
计算机解决问题的过程
执行该算法,当x的值为5时,( )
Dim a(1 To 5) As Integer, i As Integer, c As Integer
a(1)=2:a(2)=1:a(3)=3:a(4)=4:a(5)=5
c=0
For i=3 To 5
If a(i-2)+a(i-1)=a(i) Then c=c+1
Next i
Text1.Text=Str(c)
该程序段运行后,文本框Text1中显示的内容是( )
x=25: y=20
If x>y Then
y =y+20
If y>50 Then y=y^2
Else
y=y^2
y=x+y
End If
Label1. Caption=Str(y)
该程序段执行后,标签Labell中显示的内容是( )
x=″abcdcba″:ans=0
For i=1 To Len(x)\2
If Mid(x,i,1)=Mid(x,Len(x)-i+1,1) Then
ans=ans+1
end if
Text1.Text=Str(ans)
试题篮