VB大作业 判断属相 帮帮忙吧 急用 谢谢
1个回答
展开全部
Private Const s As String = "鼠牛虎兔龙蛇马羊猴鸡狗猪"
Private Sub Command1_Click()
Dim i As Integer
i = CInt(Text1.Text)
Text2.Text = Mid(s, (i - 1900) Mod 12 + 1, 1)
End Sub
function GetSuXing(Year as integer) as string
dim s as string
s="鼠牛虎兔龙蛇马羊猴鸡狗猪"
GetSuXiang = Mid(s, (Year-1900) Mod 12 + 1, 1)
end function
private Command1_Click()
text2.text=GetSuXing(text1.text)
end sub
两种方法 差不多了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询