杭电oj-Vowel Counting

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
	int T,first=1;
	char s[51],c;
	scanf_s("%d", &T);
	while (T--)
	{
		if(first)
		c = getchar();
		first = 0;
		gets_s(s);
		for (int i = 0; i < strlen(s); i++)
		{
			if (s[i]>='a'&&s[i] <= 'z')
			{
				if (s[i]=='a'|| s[i] == 'e'|| s[i] == 'i'|| s[i] == 'o'|| s[i] == 'u')
					s[i] -= 32;
			}
			else
			{
				if (s[i]=='A'|| s[i] == 'E'|| s[i] == 'I'|| s[i] == 'O'|| s[i] == 'U');
				else
					s[i] += 32;
			}
		}
		printf("%s\n", s);	
	}
	system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43411988/article/details/83960419