VB选择结构几个经典例子

2025-03-23 04:53:38
推荐回答(1个)
回答1:

1、
if x>3 then x=3
2、
if x>3 then x=3 else x=0
3、
if x>3 then 
 x=3
else
 x=0
endif
4、
if x>3 then 
 x=3
elseif x<3 then
 x=0
else
 x=-1
endif
5、
select case x
 case is>3
  x=3
 case is<3
  x=0
 case else
  x=-1
end select