级联式if语句与switch语句,有什么区别

2024-11-22 16:39:54
推荐回答(1个)
回答1:

swith(i)
{
case 1: ...
break;
case 2: ...
break;
}

if(i == 1) ...
else
if(i == 2) ...