看来没有学过C啊,switch是不能当if的理解去用的,尽管可以和if等价
给出switch版本,但是可以明显的看到switch语句用在此场合下没有if语句好
记得要用break;
clear;clc;
s=input('请输入数字');
switch s
case 0,
case 1,
case 2,
case 3,
case 4,
case 5,
case 6,
case 7,
case 8,
case 9,
r='不好';
break;
case 10
r='十环';
break;
otherwise
r='不可能';
end,s,r