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

来源:百度知道 编辑:UC知道 时间:2024/07/02 12:59:03
男 8岁以下--小弟弟 8--15岁----小男孩 16-24岁-----小伙子
女 8岁以下--小妹妹 8-15岁-----小女孩 16-24------小姑娘
男女合起来是一题

<%
if sex="m" then
if age<8 then
ed_name="小弟弟"
elseif age<=15 then
ed_name="小男孩"
elseif age<=24 then
ed_name="小伙子"
end if
end if
response.write ed_name
%>

打错了
<%
Age_Sex = IIf(Sex = "男", IIf(Age < 8, "小弟弟", IIf(Age >= 8 And Age <= 16, "小男孩", IIf(Age > 16 And Age < 24, "小伙子", "不能识别"))), IIf(Sex = "女", IIf(Age < 8, "小姑娘", IIf(Age >= 8 And Age <= 16, "小女孩", IIf(Age > 16 And Age < 24, "小姑娘", "不能识别"))), "另类"))
<br>response.write Age_Sex
<br>%>