switch的用法

#define _CRT_SECURE_NO_WARNINGS
#include
int main()
{
	char letter;
	scanf("%c", &letter);
	switch (letter)
	{
	case'a':
		printf("alpha\n");
		break;
	case'b':
		printf("bravo\n");
		break;
	case'c':
		printf("charlie\n");
	case'd':
		printf("delta\n");
		break;
	case'e':
		printf("echo\n");
		break;
	case'f':
		printf("foxtrot\n");
		break;
	case'g':
		printf("golf\n");
		break;
	default:
		printf("i don't know\n\n");

	}
	return 0;
}

你可能感兴趣的:(算法)