请教一个ASP条件语句

来源:百度知道 编辑:UC知道 时间:2024/05/24 13:50:42
条件:a>10时,显示好,否则显示坏
<%
if a>10 then
response.write "好"
else response.write "坏" end if
%>

上面的我是理解的,我的问题是:
当a<10时,显示为坏
当a>10但<20时,显示为一般
当a>20但<30时,显示为不错
当a>30时,显示为好

那么应该怎么写?
请把答案语句写出来

if a<10 then response.write "为坏"
if a>10 and a<20 then response.write "一般"
if a>20 and a<30 then respose.write "不错"
if a>30 then response.write "好"

======================================================
if a<10 then
response.write "为坏"
elseif a>10 and a<20 then
response.write "一般"
elseif a>20 and a<30 then
respose.write "不错"
elseif a>30 then
response.write "好"
end if

可以用
switch as 配合if else 来写 应该没有什么问题