帮帮我,一个快崩溃的毕业生,VB程序设计问题
发布网友
发布时间:2022-04-19 20:03
我来回答
共1个回答
热心网友
时间:2023-09-18 10:09
1..
Const pi As Single = 3.14159
'1(孤度)=180度/圆周率"派"(那个符号打不出来)=57.30度
'1度=圆周率"派"(那个符号)/180 约等于 0.01745
Private Sub Command1_Click()
Dim d!, hd!
hd = Val(InputBox("请输入弧度!"))
d = 180 / pi * hd
Print hd; "弧度等于"; d; "度!"
End Sub
Private Sub Command2_Click()
Dim d!, hd!
d = Val(InputBox("请输入角度!"))
hd = Format(pi / 180 * d, "0.000000")
Print d; "度等于"; hd; "弧度!"
End Sub
2.
Private Sub Command1_Click()
Dim i%, s%(10), min%, max%
Randomize
min = 201: max = 99
For i = 1 To 10
s(i) = Int(Rnd * 101 + 100)
If s(i) > max Then max = s(i)
If s(i) < min Then min = s(i)
Print s(i)
Next
Print "最大和最小值分别是:"; max; min
End Sub
3.
不用编程了,直接print 0
呵呵,从-100到-200, 全是负数, 哪来的正整数?
4.
Private Sub Command1_Click()
Dim i%, j%, s&, n%, t&
n = Val(InputBox("请输入N"))
For i = 1 To n
t = 1
For j = 1 To i
t = t * j
Next
s = s + t
Next
Print s
End Sub
5.这个也不用编程了,所有的5和7的倍数都是!!
同时为5和7和倍数的数,那肯定是能同时被5和7整除的
6.
for i=1 to 1000
print "☆"
next