用vb程序做以下题目,非常感谢啊!

1.求两个整数m和n的最大公约数。2.编写程序,在窗体上显示乘法表。3.输入一个0-100的数字,如果小于60则显示不及格,60-79显示及格,80-89显示良好,90-... 1. 求两个整数m和 n的最大公约数。
2. 编写程序,在窗体上显示乘法表。
3. 输入一个0-100的数字,如果小于60则显示不及格,60-79显示及格,80-89显示良好,90-99显示优秀,100则显示满分。
4. 编写程序,要求用户输入下列信息:姓名、年龄、通信地址、邮政编码、电话,然后将输入的数据用适当的格式在窗体上显示出来。
5. 验证“角谷猜想”。“角谷猜想”指出,对于一个自然数,若该数字为偶数,则除以2;若该数为奇数,则乘以3并加1;将得到的数再重复按该规则运算,最终可得到1。编写程序,对给定的一个数n,验证这一过程。
6. 求三位的水仙花数。所谓三位的水仙花数是指这样的数:其各位数字的立方和等于其自身,如153=1*1*1+5*5*5+3*3*3。
7. 如果一个数的因子之和等于这个数本身,则称这样的数为“完全数”。例如,整数28的因子为1,2,4,7,14,其和为1+2+4+7+14=28,因此28是一个完全数。试编写一个程序,要求输入两个正整数M和N后,计算M和N之间的所有完全数。
8. 计算:1!+2!+…+100!
9. 求2-100以内的质数。
10. 随机生成10个数,计算其平均值和最大值。
回答的时候一定要标明题号啊,十分感谢哦!
展开
 我来答
百度网友c52bc4519
2006-12-27 · 超过36用户采纳过TA的回答
知道答主
回答量:92
采纳率:0%
帮助的人:0
展开全部
你的题好多 你自己找吧 有你要的
Option Explicit
Dim i1 As Integer, j1 As Integer
Dim str1 As String
Private Sub diaoy(x As Integer, y As Integer)
Dim t As Integer
'cmd10的程序
t = x: x = y: y = t
End Sub

Private Function FindMax(a() As Integer)
Dim start As Integer, finish As Integer, i As Integer, max As Integer
start = LBound(a)
finish = UBound(a)
max = a(start)
For i = start To finish
If a(i) > max Then max = a(i)
Next i
FindMax = max
'数组元素的函数

End Function

Private Sub cmd1_Click()
Dim b(5) As Integer, i%, c%
b(0) = 12: b(1) = 58: b(2) = 98: b(3) = 67: b(4) = 49: b(5) = 24
c = FindMax(b())
Print c

End Sub

Private Sub Command1_Click()
Dim i1 As Integer, j1 As Integer
For i1 = 1 To 9
For j1 = 1 To i1
Print Tab(j1 * 8); i1 & "*" & j1 & "=" & i1 * j1;

Next j1

Print
Next i1
End Sub

Private Sub Command10_Click()
Const n = 5
Dim i%, j%, k%, t%, a(1 To 5) As Integer

Randomize
For i = 1 To n
a(i) = Int(Rnd * 90) + 10
Print a(i);
Next i
For i = 1 To n - 1 '选择N-1次
k = i 'K为最小
For j = i + 1 To n '范围
If a(j) < a(k) Then k = j
Next j
t = a(i)
a(i) = a(k)
a(k) = t
Next i
Print
For i = 1 To n
Print a(i);
Next i
Print

End Sub

Private Sub Command11_Click()
Dim x%, y%
x = Int(Rnd * 100)
y = Int(Rnd * 100)
Print "调用前:"
Print "x"; x, "y"; y
Call diaoy(x, y)
Print "交换后"
Print "x"; x, "y"; y

End Sub

Private Sub Command12_Click()
Static x As Integer
If x < 100 Then
x = x + 1
Text1 = Text1 + Str(x)
Call Command13_Click
Else
End If

End Sub

Private Sub Command13_Click()
Static q As Integer
If q < 100 Then
q = q + 1
Call Command12_Click
Else
End If
End Sub

Private Sub Command14_Click()

Call PrintNum(0)
End Sub

Sub PrintNum(ByVal Num As Long)
Dim i As Long

i = Num + 1
Print i;
If i < 100 Then PrintNum i

End Sub

Private Sub Command2_Click()
Dim ji As Integer, d As Integer
Print "9*9表"
Print: Print
Print "" & "*";
For i1 = 1 To 9
Print Tab(i1 * 6); i1;
Next i1
Print
For j1 = 1 To 9
Print j1; " ";
For d = 1 To j1

ji = d * j1
Print Tab(d * 6); ji; "";
Next d
Print
Next j1
End Sub

Private Sub Command3_Click()
Dim j%, s%, k%, p%, n%
n = Val(InputBox("输入N项:"))
s = 0
For k = 1 To n
p = 1
For j = 1 To k
p = p * j

Next j
Print "s"; s, p
s = s + p
Next k
Print "s"; s
End Sub

Private Sub Command4_Click()
Dim s%, i%
s = 0
i = 1
pp:
s = s + i
i = i + 1
If i <= 100 Then GoTo pp
Print "S"; s
End Sub

Private Sub Command5_Click()
Dim i%, j%, k%, n%
For i = 1 To 9
For j = 0 To 9
For k = 0 To 9
n = i * 100 + j * 10 + k
If i ^ 3 + j ^ 3 + k ^ 3 = n Then Print n
Next k
Next j
Next i
Print
End Sub

Private Sub Command6_Click()
Dim i%, j%, k%, n%
'百i=n/100.....水仙3位数
For n = 100 To 999
i = n \ 100
j = n \ 10 - i * 10
k = n Mod 10
If i ^ 3 + j ^ 3 + k ^ 3 = n Then Print n
Next n
Print
End Sub

Private Sub Command7_Click()
Dim i%, j%
For i = 1 To 9
Print Tab(10 - i);
For j = 1 To i * 2 - 1
Print Trim(Str(9 - i + 1));
Next j
Print
Next i
End Sub

Private Sub Command8_Click()
Const n = 10
Dim i(1 To n) As String * 1, j%, k$
Randomize
For j = 1 To n
i(j) = Chr(Asc("A") + Rnd * 25) '26个字母
Print i(j);
Next j
For j = 1 To n \ 2 '交换一半
k = i(j) '交换
i(j) = i(n - j + 1)
i(n - j + 1) = k
Next j
Print
For j = 1 To n
Print i(j);
Next j
Print
End Sub

Private Sub Command9_Click()
Const m = 4, n = 5
Dim i%, j%
Dim a(1 To m, 1 To n) As Integer, e(1 To n, 1 To m) As Integer
For i = 1 To m
For j = 1 To n
a(i, j) = Int(Rnd * 50)
e(j, i) = a(i, j)
Print a(i, j);
Next j
Print
Next i
For i = 1 To n
For j = 1 To m
Print e(i, j);
Next j
Print
Next i
Print
End Sub

Private Sub Form_Click()
Dim i1 As Integer, j1 As Integer
i1 = 1
j1 = 1
Print
Do Until i1 > 9
Do Until j1 > i1
Print Tab(j1 * 8); i1 & "*" & j1 & "=" & i1 * j1;
j1 = j1 + 1
Loop
Print
j1 = 1
i1 = i1 + 1
Loop

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Print "KeyCode:"; KeyDown
End Sub

Private Sub Form_Load()

str1 = "军中绿花寒风飘飘落叶军队是一朵绿花亲爱的战友你不要想家不要想妈妈声声我日夜呼唤多少句心里话不要离别时两眼泪花"
Label1.Caption = str1
Label1.Left = 400

End Sub

Private Sub Timer1_Timer()
Label1.Caption = str1
Dim i As Integer, j As String
If str1 = "" Then
Timer1.Enabled = False
Else

i = Val(Len(str1)) - 1
j = Right$(str1, (i - 1))
str1 = j
End If

End Sub
百度网友12ad932
2006-12-28 · TA获得超过494个赞
知道小有建树答主
回答量:156
采纳率:0%
帮助的人:129万
展开全部
1. 求两个整数m和 n的最大公约数

Private Sub Command1_Click()
Dim Counter, MinorValue, Result As Long
Result = 1
If CLng(Text1.Text) < CLng(Text2.Text) Then
MinorValue = CLng(Text1.Text)
Else
MinorValue = CLng(Text2.Text)
End If
For Counter = 1 To MinorValue
If CLng(Text1.Text) Mod Counter = 0 And CLng(Text2.Text) Mod Counter = 0 Then
Result = Counter
End If
Next
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
开心又顺利的萨摩耶7
2006-12-29
知道答主
回答量:10
采纳率:0%
帮助的人:0
展开全部
Private Sub Command1_Click()
Dim Counter, MinorValue, Result As Long
Result = 1
If CLng(Text1.Text) < CLng(Text2.Text) Then
MinorValue = CLng(Text1.Text)
Else
MinorValue = CLng(Text2.Text)
End If
For Counter = 1 To MinorValue
If CLng(Text1.Text) Mod Counter = 0 And CLng(Text2.Text) Mod Counter = 0 Then
Result = Counter
End If
Next
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
天外琴音
2006-12-27 · TA获得超过273个赞
知道小有建树答主
回答量:503
采纳率:0%
帮助的人:269万
展开全部
这么多题目,才10分啊,你要是出200分,我全给你做了
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
icefang1015
2006-12-28 · TA获得超过1075个赞
知道小有建树答主
回答量:307
采纳率:0%
帮助的人:201万
展开全部
这些题都不难,动动脑子,你能做出来的
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(3)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式