> 其他 >
VB 编写函数fun,函数的功能是:求1-1000内能同时被m,n整除的数的总和并显示.
人气:199 ℃ 时间:2019-10-26 02:48:37
解答
Function s(ByVal a As Integer,ByVal b As Integer) As Integer
Dim i As Integer
For i = 1 To 1000
If i Mod a = 0 And i Mod b = 0 Then
s = s + i
End If
Next
End Function
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版