sub shengxiao()
dim shengxiao(12)
shengxiao(12)=("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪")
dim year
dim pyear
pyear=(year-1996)%12
document.write(shengxiao(pyear))
end sub
<script language="vbscript">
sub mysub()
year_num= InputBox("输入年份")
do while Trim(year_num)="" or Not IsNumeric(Trim(year_num))
year_num= InputBox("输入有错,请重新输入年份")
Loop
temp="鼠,牛,虎,兔,龙,蛇,马,羊,猴,鸡,狗,猪"
shengxiao=split(temp,",")
i=(cint(year_num)-1996) mod 12
if i<0 then i=i+12
msgbox "该年是:"+shengxiao(i)+"年"
end sub
call mysub()
</script>