vb问题答案急需
答案:1 悬赏:50 手机版
解决时间 2021-08-15 01:13
- 提问者网友:我一贱你就笑
- 2021-08-14 07:03
vb问题答案急需
最佳答案
- 五星知识达人网友:不甚了了
- 2021-08-14 07:55
建立以下控件(根据需要布局自己调整,可以加入label标签说明文字)。复制以下代码:Private Sub Command1_Click() Randomize Text1.Text = Int(Rnd * 90) + 10 Text2.Text = Int(Rnd * 100) + 100 Command2.Enabled = TrueEnd SubPrivate Sub Command2_Click() a = Val(Text1.Text) b = Val(Text2.Text) For i = a To 1 Step -1 If a Mod i = 0 And b Mod i = 0 Then Text3.Text = i Exit For End If Next i For i = b To a * b If i Mod a = 0 And i Mod b = 0 Then Text4.Text = i Exit For End If Next i Command3.Enabled = TrueEnd SubPrivate Sub Command3_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Command2.Enabled = False Command3.Enabled = FalseEnd SubPrivate Sub Form_Load() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Command1.Caption = "随机数" Command2.Caption = "公倍数与公约数" Command3.Caption = "清空" Command2.Enabled = False Command3.Enabled = FalseEnd Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯