十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
问题不是很简单吗?
10年积累的成都网站设计、网站制作经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有宿松免费网站建设让你可以放心的选择与我们合作。
判断输入的数,大于等于零,则直接开方;小于零则取绝对值开方再加上字符"i",代码我就不写了.
VB.NET codeDim rng As Word.Range = oDoc.Range(0, 0) rng.Font.Name = "Verdana" rng.Font.Size = 16 Dim tlb As Word.Table = oDoc.Tables.Add(Range:=rng, NumRows:=4, NumColumns:=3)
这是VB建Word文档的表格
在按钮单击事件写
dim i,a,b,c
a=1
c=inputbox("请输入平方得个数,例如10")
for i=a to c
b=b+a^2
a=a+1
next i
print b
以下是平方镜在vb.net中的程序,需要一个 listbox和command
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim xx As Long, j As String, i As String
xx = InputBox("请输入最大范围数", 100000)
For m = 10 To xx
i = m
j = StrReverse(i)
If i = j Then GoTo 10
If Int(i) ^ 2 = StrReverse(Int(j) ^ 2) Then
ListBox1.Items.Add(i " " j " " i ^ 2 " " j ^ 2)
End If
10:
Next
End Sub
End Class
如果想在vb6中运行 就把 ListBox1.Items.Add 改成 list1.additem
Public Function panduan(ByVal n As Integer) As Boolean
Dim res As Boolean = False
Dim a, b, c, d, temp1, temp2 As Integer
a = n \ 1000
b = (n \ 100) Mod 10
c = (n \ 10) Mod 10
d = n Mod 10
temp1 = Sqrt(n)
temp2 = Sqrt(a + b + c + d)
If temp1 * temp1 = n And temp2 * temp2 = (a + b + c + d) Then
res = True
End If
Return res
End Function
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Dim str As String = "", temp As Integer = 0, sum As Integer = 0, x As Integer
For i = 1000 To 9999 Step 1
If panduan(i) Then
temp = i
Exit For
End If
Next
TextBox6.Text = temp
End Sub
拖三个textbox,一个button
在窗体上双击button1,在自动生成的button1的Click事件中:
textbox2.text=val(textbox1.text)^2
textbox3.text=val(textbox1.text)^3