关于switch选择语句的使用

#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
using namespace std;

int main()
{
	int a = 1;
	int b = 2;
	switch (a)
	{
	 case 1:
		b++;
	 case 2:
		a++;
	 case 3:
		switch (a)
		{
	     	default:
			  break;
		    case 1:
			a++;
		    case 2:
			a++;
			b++;
			break;
		}
	 case 4:
		b++;
		break;
	 default:
		break;
	}
	  printf("a=%d,b=%d\n", a, b);
	return 0;
}

你可能感兴趣的:(c++)