//一般容易出语法错误的算法:
...
switch(x)
{
case (x<-5) :
y=x;
break;
case (x=0):
y=x-1;
break;
case (0<x<10) :
y=x+1;
break;
default:
...;
break;
}
...
**************************************************************************************
//牵强能符合题意的
...
if(x>=10)
printf("error!");
else
switch(x)
{
case 0:
y=x-1;
break;
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
y=x+1;
break;
case -5:
case -4:
case -3:
case -2:
case -1:
printf("error");
break;
default:
y=x;
break;
}
...
[此贴子已经被作者于2005-10-27 18:58:53编辑过]