Private Sub Command1_Click()
If Text1Text <> "" And Text2Text <> "" Then
Call qiuzhi(CInt(Text1Text), CInt(Text2Text))
Else
MsgBox "请输入两个数"
End If
End Sub
Private Function qiuzhi(ByVal m, n As Integer)
Dim max, min As Integer
If m > n Then
max = m
min = n
Else
max = n
min = m
End If
MsgBox "最大值是:" & max & ";最小值是:" & min
End Function
#include<stdioh> int fun(); void main(void) { int i,n,a[500]; n = fun(a); for(i = 0; i < n; i++) printf("%d ",a[i]); } int fun (int a[]) { int i = 7, j = 0; for(; i <= 1000; i++) if (i % 7 == 0 || i % 11 == 0) if ( !(i % 77 == 0 && i % 11 == 0) ) a[j++] = i; return j ; }
Private Sub Command1_Click()
Dim n As Integer
n = 100
f n
End Sub
Function f(n As Integer) As Single
Dim i As Integer
For i = 1 To n
f = f + 1 / i
Next i
Print "1+1/2+1/3+…+1/100结果为:" & f
End Function
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)