题目
用Do...Loop循环语句,求m和n的最大公约数,以下是程序代码,
Private Sub Command1_Click()
Dim m As Long,n As Long,t As Long
m = Val(Text1.Text)
n = Val(Text2.Text)
If m < n Then
t = m:m = n:n = t
End If
Do
r = m Mod n
m = n
n = r
Loop While r 0
Label1.Caption = m
End Sub
Private Sub Command1_Click()
Dim m As Long,n As Long,t As Long
m = Val(Text1.Text)
n = Val(Text2.Text)
If m < n Then
t = m:m = n:n = t
End If
Do
r = m Mod n
m = n
n = r
Loop While r 0
Label1.Caption = m
End Sub
提问时间:2021-03-19
答案
Private Sub Command1_Click()
Dim m As Long, n As Long, t As Long
m = Val(Text1.Text)
n = Val(Text2.Text)'两个文本框中分别输入整数m和n
If m < n Then '如果m
Dim m As Long, n As Long, t As Long
m = Val(Text1.Text)
n = Val(Text2.Text)'两个文本框中分别输入整数m和n
If m < n Then '如果m
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
热门考点
- 1硫酸氢钠熔融能否用氧化铝坩埚?
- 2英语翻译
- 3一次函数y(3m-7)x+m-7的图像于y轴的交点在x轴的上方,且y随x的增大而减少,m为整数
- 4微分方程xdx+((x^2)y+y^3+y)dy=0的通解.
- 5May I borrow your MP4?怎样回答
- 6include和including的区别
- 7My mother is a housewife.She doesn’t work.She stays at home.She is beautiful.She has long hair.She d
- 8语文童谣不要多于100字.
- 9怎样求叶形、椭圆等(透镜)的焦点、焦距以及偏心率
- 102.5平方米=_平方米_平方分米. 67平方厘米=_平方分米.