编写VB程序,打印1到100所有数的平方,平方根,自然对数,e指数的数用表
应该是你所需要的吧,需要源文件,私信我。
Private Sub Command3_Click() Dim s As String s = "" For i = 1 To 100 s = s & i & "^2=" & i ^ 2 & " sqrt(" & i & ")=" & Sqr(i) & " e^" & i & "=" & Exp(i) & vbCrLf Next i Text1.Text = sEnd Sub
Private Sub Command1_Click()Dim p As Long, g As Single, l As Single, e As Double
Print "数值", "平方 ", "平方根 ", "自然对数 ", " e指数"
For i = 1 To 100
p = i ^ 2
g = Sqr(i)
l = Log(i)
e = Exp(i)
Print i, p, g, l, e
Next
End Sub
VB 编程序找出1到1000之内的完数,并打印出它的因子
完数,完全数(Perfect number),又称完美数或完备数,是一些特殊的自然数。它所有的真因子(即除了自身以外的约数)的和(即因子函数),恰好等于它本身。如果一个数恰好等于它的因子之和,则称该数为“完全数”。VB可是使用Mod运算符求余和嵌套循环来找出完数。Mod 运算符,用来对两个数作除法并且...
编写vb程序自然数1∼1000中能被5和7同时整除时的数打印出来,并统计其...
新建一个工程,添加一个Command1,添加一个List1 Private Sub Command1_Click()Dim Sum As Long Sum = 0 For i = 1 To 1000 If i Mod 5 = 0 And i Mod 7 = 0 then list1.additem i:Sum = Sum +1 Next MsgBox "1-1000中能被5和7同时整除的数有" & Sum & "个"End Sub ...
vb程序编写程序,输出由1,2,3,4,5,6这六个数组成的所有可能的两位数...
Private Sub Command1_Click()Dim i As Integer, j As Integer Dim a As Integer, s As Integer For i = 1 To 6 For j = 1 To 6 a = i * 10 + j s = s + a Print a;Next Print Next Print "总和:", s End Sub
用VB写设计程序代码,求:s=1+(1+2)+(1+2+3)+……+(1+2+3+……+n)的值...
Function sumD(n As Integer) As Single s = 1 i = 1 Do i = i + 1 s = s + 1 \/ i Loop Until i >= n sumD = s End Function Function sumF(n As Integer) As Single s = 0 For i = 1 To n s = s + 1 \/ i Next i sumF = s End Function Private Sub Form_...
vb程序编写一个函数过程,打印出5!8!10!
Sub s() Dim i%, p# p = 1 For i = 1 To 10 p = p * i If i = 5 Or i = 8 Or i = 10 Then Debug.Print i & "!=" & p NextEnd Sub
请教:用vb写了一个打印当前页的命令,但总是出现打印窗口,有没有办法不...
Sub Macro1()'' Macro1 Macro ' 宏在 10-02-04 由 user 录制 'Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintTo...
高分求一段VB6.0的打印代码
vbPRPSEnvPersonal 38 Envelope, 3 5\/8 x 6 1\/2 in.vbPRPSFanfoldUS 39 U.S. Standard Fanfold, 14 7\/8 x 11 in.vbPRPSFanfoldStdGerman 40 German Standard Fanfold, 8 1\/2 x 12 in.vbPRPSFanfoldLglGerman 41 German Legal Fanfold, 8 1\/2 x 13 in.以下两行用于打印:Printer.Print...
哥哥我刚开始接触编程 想去学校竞赛组,但是要考核,老师让我用vb写1
Dim a As Integer Dim b As Integer For a = 1 To 9 For b = 1 To a Print CStr(b) & "*" & CStr(a) & "=" & CStr(a * b); Spc(2);Next b Print Next a
...10),任选出7个作为一个组合(数字不可重合),打印出所有的组合...
for j=0 to 9 xy=i*10+j print xy 你可以看出,以上这个只是打出了两个数字位组合的所有可能,并没有打印出你想要的结果,那么加入if调试的话就成了 for i=0 to 9 for j=0 to 9 if i=j then 跳出j的循环;else xy=i*10+j print xy 注:以上只是给你个思想,至于B语言写的对不...
VB的一个程序,帮忙编一下,谢谢
Private Sub Command1_Click() '倒三角形 Dim S As String, i As Integer, n As Integer S = "*"n = InputBox("输入要打印的行数:")For i = n To 1 Step -1 Print Space(n - i) + String(2 * i - 1, S)Next i End Sub Private Sub Command2_Click()Dim S As String,...
江霞近视:[答案] dim i as long dim sum as long sum=0 for i=1 to 100 step 2 sum=sum+i next i print sum
个旧市18877631699: 编写VB程序,打印1到100所有数的平方,平方根,自然对数,e指数的数用表 - ?
江霞近视: Private Sub Command1_Click() Dim p As Long, g As Single, l As Single, e As Double Print "数值", "平方 ", "平方根 ", "自然对数 ", " e指数" For i = 1 To 100 p = i ^ 2 g = Sqr(i) l = Log(i) e = Exp(i) Print i, p, g, l, e Next End Sub
个旧市18877631699: vb编写程序,计算并打印1到100之间的所有奇数和 (在线等) - ?
江霞近视: Private Sub Command1_Click() For i = 1 To 99 Step 2 s = s + i Next i Print s End Sub
个旧市18877631699: 用VB编程输出1到100的素数,用简单一点的那种,谢啦 - ?
江霞近视: Dim i As Long, j As Long, k As LongFor i = 1 To 100k = Int(Sqr(i))For j = 2 To kIf i Mod i = 0 Then Exit ForNext jIf j > k Then Print jNext i
个旧市18877631699: vb从1加到100怎么列 - ?
江霞近视: 1、打开VB6.0软件,新建一个标准exe工程;2、设计界面上添加一个Command控件;3、双击Command1控件,进入代码编辑,输入如下代码:Private Sub Command1_Click() Dim sum As Integer sum = 0 For i = 1 To 100 sum = sum + i Next i Print sum; End Sub4、点击运行程序,单击按钮,可以看到1到100的和:
个旧市18877631699: vb代码 输出一百个数 - ?
江霞近视: for i=1 to 100 print tab(5*(i mod 10));i; if i mod 10=0 then print next i
个旧市18877631699: VB编程:点击窗体输出100以内的完全数 - ?
江霞近视: Private Function yinzihe(x As Integer) As Integer Dim i As Integer For i = 1 To x - 1 If x Mod i = 0 Then yinzihe = yinzihe + i End If Next i End Function Private Sub Form_Click() Dim i As Integer For i = 1 To 100 If yinzihe(i) = i Then Print i; Next i End Sub 用一个函数过程求出一个数的真因子和.
个旧市18877631699: 如何利用vb输出1到一百所有素数的和? - ?
江霞近视: Private Sub Command1_Click() Dim i As Long, j As Long, SV As Long Dim BB As Boolean SV = 0 For i = 2 To 100 BB = False For j = 2 To i - 1 If (i Mod j) = 0 Then BB = True: Exit For Next If BB = False Then SV = SV + i End If Next Text1.Text = SV'素数的和 End Sub
个旧市18877631699: 编程求1到100之间所有数的和 ?
江霞近视: 用vb可以如下编程: dim sam&,n% for n=1 to 100 sam=sam+n next n
个旧市18877631699: vb中怎么输出1到100之间的所有质数? - ?
江霞近视: private sub command1_click() for i = 3 to 100 for j = 2 to sqr(i) if i mod j = 0 then exit for next if j > int(sqr(i)) then s = s & i & " " next msgbox s end sub