回覆列表
-
1 # 態度4131
-
2 # 半仙龍
"手動Private Sub Command1_Click()"和Text3.Text = Val(Text1.Text) + Val(Text2.Text)"差Text3.Text = Val(Text1.Text) - Val(Text2.Text)End Sub"自動Private Sub Command2_Click()"隨機數Text1.Text = Int((100 - 10 + 1) * Rnd + 10)Text2.Text = Int((100 - 10 + 1) * Rnd + 10)"和Text3.Text = Val(Text1.Text) + Val(Text2.Text)"差Text3.Text = Val(Text1.Text) - Val(Text2.Text)End Sub
dim i as integer,s as integer,s1 as singles=0for i =1 to 20Randomizes=s+(100)rnd+1 "和next iprint ss1=s/20 "平均值print s1最大值的演算法:dim a(1 to 21)a(1)=1for i =1 to 20Randomizea(i+1)=(100)rnd+1if a(i)>a(i+1) then x=a(i)next iprint x