求大神帮忙,万分感谢了,急急急急急急急急!!!!!!

1. 程序
Private Static Sub Command1_Click()
Dim x As Integer, s As Integer
x = Val(InputBox("请输入一个正整数="))
If x < 5 Then
s = s * x
Else
s = s + x
End If
Text1.Text = "s=" + Str(s)
End Sub
程序运行时连续三次单击Command1,且设输入的数是5、2和4时,分别写出文本框Text1.Text的值。

2. 阅读下列程序,写出运行结果。
Private Sub Command1_Click()
n = 0: x = 1: y = 0
Do While x < 20
n = n + 1
y = x + y
x = x * (x + 1)
Loop
Text1.Text = "n=" & Str(n)
Text2.Text = "x=" & Str(x)
Text3.Text = "y=" & Str(y)
End Sub
程序运行时单击Command1后,分别写出文本框Text1、Text2和Text3的Text值。

3.
Private Sub Form_Click()
Dim x(5) As Integer
x(1) = 8: x(2) = 3: x(3) = 1: x(4) = 6: x(5) = 4
For i = 1 To 4
For j = i + 1 To 5
If x(i) < x(j) Then t = x(i): x(i) = x(j): x(j) = t
Next j, i
For k = 1 To 5
Form1.Print "x("; k; ")="; x(k)
Next k
End Sub
写出程序运行时单击窗体后,Form1上的输出结果。

4. 写出程序运行时单击窗体后,Form1上的输出结果。
Private Sub Form_Click()
Dim a(2, 3) As Integer
For i = 1 To 2
For j = 1 To 3
a(i, j) = 2 * i - j
Next j, i
For h = 1 To 3
For k = 1 To 2
Form1.Print a(k, h),
Next k

编写程序

1、在一个窗体上放置一个命令按钮,通过Click事件中随机生成100个2位正整数,把其中奇数的个数显示在文本框里。

2. 用输入对话框输入x,根据下式计算对应的y,并在窗体上输出y的值。
(注:程序写在命令按钮Command1的Click事件中)
ex x>10
y= 0 x=10
3x+5 x<10

1、s=5 s=0
2、3,42,9
3、a(1)=8
a(2)=6
a(3)=4
a(4)=3
a(5)=1
4、1 3 0 2 -1 1

1
Private Sub Command1_Click()
dim a(99) as integer
for i=0 to 99
a(i)=int(rnd*90+10)
if a(i) mod 2 =1 then n=n+1
next
text1.text=n
end sub

2、
Private Sub Command1_Click()
x=val(inputbox("请输入X的值"))
if x>10 then
y=e*x
elseif x=10 then
y=0
elseif x<10
y=3*x+5
end if
print "y=";y
end sub
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答