当前位置:新励学网 > 秒知问答 > 正整数的表示方法

正整数的表示方法

发表时间:2024-07-28 04:45:55 来源:网友投稿

Private Sub Command1_Click()

If CheckInt(Text2.Text) = True Then

MsgBox "正整数"

Else

MsgBox "不是正整数"

End If

End Sub

Function CheckInt(ByVal str As String) As Boolean

If InStr(1, str, ".") = 0 Then

If str > 0 Then

CheckInt = True

Else

CheckInt = False

End If

Else

CheckInt = False

End If

End Function

'日曜星君

免责声明:本站发布的教育资讯(图片、视频和文字)以本站原创、转载和分享为主,文章观点不代表本网站立场。

如果本文侵犯了您的权益,请联系底部站长邮箱进行举报反馈,一经查实,我们将在第一时间处理,感谢您对本站的关注!