程序阅读,程序功能是什么Private Sub Command1_Click()Dim s%,n%Dim a As Stringn=0a=InputBox(“Please input a number:”)For s=1To Len(a)If(func(Val(Mid(a,s,1)))) Then n=n+1NextPrint nEnd SubPrivate Function func(x%) As BooleanIf(x Mod 2=0)
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/09 10:36:14
程序阅读,程序功能是什么Private Sub Command1_Click()Dim s%,n%Dim a As Stringn=0a=InputBox(“Please input a number:”)For s=1To Len(a)If(func(Val(Mid(a,s,1)))) Then n=n+1NextPrint nEnd SubPrivate Function func(x%) As BooleanIf(x Mod 2=0)
程序阅读,程序功能是什么
Private Sub Command1_Click()
Dim s%,n%
Dim a As String
n=0
a=InputBox(“Please input a number:”)
For s=1To Len(a)
If(func(Val(Mid(a,s,1)))) Then n=n+1
Next
Print n
End Sub
Private Function func(x%) As Boolean
If(x Mod 2=0) Then
func=True
Else
func=False
End If
End Function
程序阅读,程序功能是什么Private Sub Command1_Click()Dim s%,n%Dim a As Stringn=0a=InputBox(“Please input a number:”)For s=1To Len(a)If(func(Val(Mid(a,s,1)))) Then n=n+1NextPrint nEnd SubPrivate Function func(x%) As BooleanIf(x Mod 2=0)
输入一串数字 计算其中偶数的数量