switch的使用 #include <stdio.h> void main () { int i; scanf ( "%d",&i ); switch ( i )//()内没有限定,不要使用&&和||他们的返回值是1只对应1 { case 0 : case 1 : printf("1");break; case 2 : printf("2");break; } }