C++转vbscript代码求解(一小段代码)

ghostfish 2004-01-01 12:17:05
char* ShengXiao[12]={"鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"};
int year,pyear;
cin>>year;
pyear=(year-1996)%12;

cout<<"该年是"<<*(ShengXiao+((pyear>=0)?pyear:12+pyear))<<"年\n";
...全文
40 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jorn 2004-01-01
  • 打赏
  • 举报
回复
sub shengxiao()
dim shengxiao(12)
shengxiao(12)=("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪")
dim year
dim pyear
pyear=(year-1996)%12
document.write(shengxiao(pyear))
end sub
possible_Y 2004-01-01
  • 打赏
  • 举报
回复
<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>

直接保存上面代码为.htm文件即可

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧