jmfs.net
当前位置:首页>>关于vb程序设计编写程序题的资料>>

vb程序设计编写程序题

Private Sub Command1_Click()'按钮一(-50,50) Dim n1 As Long, n2 As Long, n As Long Randomize n1 = -50: n2 = 50 n = Int(((n2 - n1) + 1) * Rnd + n1) Label1 = n End Sub Private Sub Command2_Click()'按钮二(0,99.99) Dim n1 As

编写计算机程序需要使用计算机编程语言.计算机编程语言是人和计算机“对话”的桥梁.就像人类的语言一样,计算机编程语言也有很多.目前较为广泛使用的语言有“c++”、“pascal”、“basic”等.在众多的计算机编程语言中,以basic

第一个:Private Sub Form_Load() Show Dim N As Integer Dim j As Integer Dim sum As Double sum = 1 N = InputBox("请输入N的值,求1+1/(1+2)+1/(2+3)+1/(3+4)..的前N项和") For j = 1 To N sum = sum + 1 / (j + j + 1) Next j Print "总

啊`同样的问题``不知道是不是一个人的`我这里就把我刚回答 的给贴出来了 我用vb6写的一个`不是.net 你仿照这个写一个吧 dim u , r as boolean ' u为true时picturebox向下滚, u为 false时向上`` 同理对于r = true 向左`r=false向右 ' 以上为 全局变量

1.比如说这些数字都在数组a()中 ,那么代码为:do while a(i)=-1 if a(i) mod 2 = 0 then n_double=n_double+1 else n_single=n_single+1 i=i+1loopprint "偶数个数=" & n_double & " 奇数个数=" & n_single2.定义要付的钱为n1,实际要付的

这是我做的,我觉得完成度还好,运行过没啥问题..代码第一题(单击窗体即可)Option ExplicitDim a(1 To 20) As IntegerDim i As IntegerPrivate Sub Form_Click()Dim b As SingleDim c As StringOn Error GoTo Line1b = InputBox("请输入1到

Private Sub Cmd1_Click() Dim j As Long, n As Long n = List1.SelCount If n < 2 Then MsgBox "至少选择2项!", vbExclamation, "提示" Else For j = 0 To List1.ListCount - 1 If List1.Selected(j) Then List2.AddItem List1.List(j) End If Next

第1题:X=InputBox(请输入X的值)If X >= 0 Then Y = (1 + 4 * X) / 5Else Y = sin(2 * X - 3) / 7End IfPrint Y第2题:Private Sub Command1_Click() Dim a, b, c, V, f As Integer a = val(Text1.Text) b = val(Text2.Text) c = val(Text3.Text) V = a*b*c f = 2*(a*

试题一.1 Private Sub Form_Click() Print fs_sum(100) End Sub Function fs_sum(ByVal n As Integer) As Single Dim s!, nc! '和与倒数 s=0 For i = 1 To n nc = 1 / i s = s + nc Next i fs_sum = s End Function 试题一.2 Private Sub Form_Click() For i =

新建3个文本框,两个命令按钮,直接复制就好了,代码如下:Private Sub Command1_Click() Dim a As Long, b As Long, c As Long, e As Long, f As Long, d As Long, g As String a = Val(Text1.Text) '将字符串转化为数字. b = Val(Text2.Text) c =

gmcy.net | qimiaodingzhi.net | nczl.net | qwrx.net | mtwm.net | 网站首页 | 网站地图
All rights reserved Powered by www.jmfs.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com