写一个ASP代码,给出性别和年龄,对应输出以下信息

来源:百度知道 编辑:UC知道 时间:2024/05/28 03:20:52
男 8岁以下--小弟弟 8--15岁----小男孩 16-24岁-----小伙子
女 8岁以下--小妹妹 8-15岁-----小女孩 16-24------小姑娘

function output(sex,age)
if sex="男" then
if age<8 then output="小弟弟"
if age>=8 and age<=15 then output="小男孩"
if age>=16 and age<=24 then output="小伙子"
end if
if sex="女" then
if age<8 then output="小妹妹"
if age>=8 and age<=15 then output="小女孩"
if age>=16 and age<=24 then output="小姑娘"
end if
end fucntion

function output(sex,age)
if sex="男" then
if age<8 then output="小弟弟"
else if age<=15 then output="小男孩"
else if age<=24 then output="小伙子"
end if
if sex="女" then
if age<8 then output="小妹妹"
else if age<=15 then output="小女孩"
else if age<=24 then output="小姑娘"
end if
end fucntion