请高手帮忙解答ASP中IF语句的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 17:04:40
大家好,我有以下问题,请高手帮忙解答。
题目详细:
给出性别及年龄,对应输出以下的信息:

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

标准答案:

dim sex,age
sex="男"
age=50
if sex="男" then
if age<8 then
response.Write("小弟弟")
else
if age>=8 and age<=15 then
response.Write("小男孩")
else
if age>=16 and age<=24 then
response.Write("小伙子")
else
if age>=25 and age<=45 then
response.Write("青年男子")
else
if age>=46 and age<=55 then
response.Write("中年男子")
else
if age>=56 and age<=80 then
response.Write("老爷爷&qu

dim sex,age
sex="男"
age=50
if sex="男" then

if age<8 then response.Write("小弟弟")
if age>=8 and age<=15 then response.Write("小男孩")
if age>=16 and age<=24 then response.Write("小伙子")
if age>=25 and age<=45 then response.Write("青年男子")
if age>=46 and age<=55 then response.Write("中年男子")
if age>=56 and age<=80 then response.Write("老爷爷")
if age>80 then response.Write("老寿星")

else

if age<8 then response.Write("小妹妹")
if age>=8 and age<=15 then response.Write("小女孩")
if age>=16 and age<=24 then response.Write("小姑娘")
if age>=25 and age<=45 then response.Write("青年女子")
if age>=46 and age<=55 then response.Write("中年女子")
if age>=56 and age<=80 then response.Write("奶奶")
if age>80