• switch的参数不能为浮点数类型
  • 如果执行到一个满足条件的case,那么switch会一直执行下去,直至遇到break或者语句执行到最后才退出
  • 例如下面的程序输出2、3
#include <stdio.h>

int main()
{
    int num=2;
	switch(num)
	{
	case 1:
		printf("1\n");
	case 2:
		printf("2\n");
	case 3:
		printf("3\n");
	}

    return 0;
}