VB的题目,希望各位高手来帮个忙
8.以下是一个简化了的猜数游戏程序,自动生成一个小于1000的随机正整数与您用输入对话框输入的数进行对比,猜中后输出相关信息,过程结束。
Private Sub Form_Click()
Dim r As Integer, x As Integer, i As Integer
Randomize : r = _______________
For i = 1 To 10
x = Val(InputBox("请输入一个整数:"))
If x < r Then m = MsgBox("太小了,请继续猜!")
If x > r Then m = MsgBox("太大了,请继续猜!")
If x = r Then
Print "猜中了!共猜了" + ______________ + "次"
If i <= 5 Then Print "太棒了!" Else Print "加油!"
________________
End If
Next i
End Sub
VB.NET code:
Private Sub MainForm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Click
Dim r As Integer, x As Integer, i As Integer
Dim m As String
Randomize: r = Rnd() * 1000
For i = 1 To 10
x = Val(InputBox("请输入一个整数:"))
If x < r Then m = MsgBox("太小了,请继续猜!")
If x > r Then m = MsgBox("太大了,请继续猜!")
相关问答:
希望大家能够帮我下.感谢了..
源码传在大米盘 VB6 的源码 http://www.damipan.com/file/3wNoKLW.html
转为VB.NET源码.
小弟完全是新手 不懂的说.麻烦各位帮忙一下
我的EMAIL是:4452 ......
帮我改改 我总觉得有问题
Type ID
number As Single
score As Integer
name As String * 6
End Type
Dim personl As ID, i%
Private Sub Command1_Click()
i = 0
&nbs ......
刚接触vb6.0,有些摸不到的感觉,敬请各位大虾给点建议!!!
不会吧,推荐学习.NET。顺便推荐实用代码网站http://bingning.net/free/source/index.html。
如果没基础 就用易语言吧 中文编程呢 代码都是中文 ......
Private Sub Form_Load()
recs = Adodc1.Recordset.RecordCount '求当前记录数
If recs > 0 Then '已有考生
Adodc1.Recordset.MoveLast '移到最后一条记录
num = V ......