程序阅读,程序功能是什么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/06/27 13:33:58
![程序阅读,程序功能是什么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)](/uploads/image/z/14985896-32-6.jpg?t=%E7%A8%8B%E5%BA%8F%E9%98%85%E8%AF%BB%2C%E7%A8%8B%E5%BA%8F%E5%8A%9F%E8%83%BD%E6%98%AF%E4%BB%80%E4%B9%88Private+Sub+Command1_Click%28%29Dim+s%25%2Cn%25Dim+a+As+Stringn%3D0a%3DInputBox%28%E2%80%9CPlease+input+a+number%EF%BC%9A%E2%80%9D%29For+s%3D1To+Len%28a%29If%28func%28Val%28Mid%28a%2Cs%2C1%29%29%29%29+Then+n%3Dn%2B1NextPrint+nEnd+SubPrivate+Function+func%28x%25%29+As+BooleanIf%28x+Mod+2%3D0%29)
程序阅读,程序功能是什么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)
输入一串数字 计算其中偶数的数量