asp select case 语句问题

来源:百度知道 编辑:UC知道 时间:2024/05/18 08:45:53
题目详细:
给出性别及年龄,对应输出以下的信息:

男 8岁以下 小弟弟
8岁到15岁 小男孩
16岁到24岁 小伙子
25岁到45岁 青年男子
46岁到55岁 中年男子
56岁到80岁 老爷爷
81岁以上 老寿星
女 8岁以下 小妹妹
8岁到15岁 小女孩
16岁到24岁 小姑娘
25岁到45岁 青年女子
46岁到55岁 中年女子
56岁到80岁 奶奶
81岁以上 老奶奶

这道题用select case 语句
应该怎么做

i=cint(trim(request("年龄")))
select case i
case (i<8 and trim(request("性别"))="男")
response.write "小弟弟"
case (i>8 and i<15 and trim(request("性别"))="男")
response.write "小男孩"
'以此论退,直到最后
case (i>81 and trim(request("性别"))="女")
response.write "老奶奶"
end select