8---6

#include
#include

#define N 50

int main(void)
{
	char ch, str[N] = { 0 };

	printf("Eter message: ");
	for (int i = 0; (ch = getchar()) != '\n'; i++)
	{
		str[i] = ch;
	}

	printf("In B1FF-speak: ");
	for (int i = 0; i < N && str[i] != 0; i++)
	{
		str[i] = toupper((unsigned char)str[i]);
		switch (str[i])
		{
		case 'A':
			printf("4");
			break;
		case 'B':
			printf("8");
			break;
		case 'E':
			printf("3");
			break;
		case 'I':
			printf("1");
			break;
		case 'O':
			printf("0");
			break;
		case 'S':
			printf("5");
			break;
		default:
			printf("%c", str[i]);
			break;
		}
	}
	printf("!!!!!!!!!!");

	return 0;
}

你可能感兴趣的:(c语言)