vb一些题目。输出结果 30
1)PrivatesubForm_Click()DimN1AsInteger,N2AsInteger,N3AsIntegerN1=1:N2=1PrintN1;N2DoN3...
1)Private sub Form_Click()
Dim N1 As Integer,N2 As Integer,N3 As Integer
N1=1:N2=1
Print N1;N2
Do
N3=N1+N2
Print N3;
N1=N2:N2=N3
Loop Until N3>=5
End Sub
(2) Private Sub Form_Click()
Dim X As Integer,Y As Integer
X=5:Y=5
Do While X+Y<25
Y=Y+5:X=X+2
Print Y;
If Y >14 Then Exit Do
Loop
Print Y
End Sub
(3)Private Sub Form_Click()
Dim B As String, A As String, I As Integer
B=”GAFBXCNDH”
For I=1 to Len(B) Step 2
A=A & Chr(Asc(Mid(B,I,1))-5)
Next I
Print A,I
End Sub
(4)在下列程序中,当x的输入值分别为5,-9,0时,则程序运行的结果分别是:
Private Sub Command1_Click()
x = InputBox("Enter x")
Select Case Sgn(x) + 2
Case 1
Print "y="; x ^ 2
Case 2
Print "y="; x
Case 3
Print "y="; x ^ 3
End Select
End Sub
(5)Private Sub Form_Click()
For j = 1 To 15
A = A + j Mod 3
Next j
Print A
End Sub 展开
Dim N1 As Integer,N2 As Integer,N3 As Integer
N1=1:N2=1
Print N1;N2
Do
N3=N1+N2
Print N3;
N1=N2:N2=N3
Loop Until N3>=5
End Sub
(2) Private Sub Form_Click()
Dim X As Integer,Y As Integer
X=5:Y=5
Do While X+Y<25
Y=Y+5:X=X+2
Print Y;
If Y >14 Then Exit Do
Loop
Print Y
End Sub
(3)Private Sub Form_Click()
Dim B As String, A As String, I As Integer
B=”GAFBXCNDH”
For I=1 to Len(B) Step 2
A=A & Chr(Asc(Mid(B,I,1))-5)
Next I
Print A,I
End Sub
(4)在下列程序中,当x的输入值分别为5,-9,0时,则程序运行的结果分别是:
Private Sub Command1_Click()
x = InputBox("Enter x")
Select Case Sgn(x) + 2
Case 1
Print "y="; x ^ 2
Case 2
Print "y="; x
Case 3
Print "y="; x ^ 3
End Select
End Sub
(5)Private Sub Form_Click()
For j = 1 To 15
A = A + j Mod 3
Next j
Print A
End Sub 展开
4个回答
展开全部
希望能采纳
1:
1 1
2 3 5
2:10 15 15
3:BASIC 11
4:y=125
y=81
y=0
5:15
1:
1 1
2 3 5
2:10 15 15
3:BASIC 11
4:y=125
y=81
y=0
5:15
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1... 1,1,2
2...10,15,15
3...BASIC,11
4...125,81,0
5...15
2...10,15,15
3...BASIC,11
4...125,81,0
5...15
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询