题解 | #判断是元音还是辅音#

判断是元音还是辅音

https://www.nowcoder.com/practice/7eb4df4d52c44d309081509cf52ecbc4

#include <stdio.h>
int main()
{
	char c = 'B';
	
	char str[] = "AEIOUaeiou";
	while (scanf("%c",&c)!=EOF)
	{
		getchar();
		int i = 0;
		while (str[i])
		{
			if (c == str[i])
			{
			printf("Vowel\n");
			break;
			}
			i++;
		}
		if (str[i] == '\0')
			printf("Consonant\n");
	}
	return 0;
}

全部评论
int is_exsit(char ch, char* str) { int i = 0; while (str[i]) { if (ch == str[i]) return 1; i++; } return 0; } int main() { char c; char str[] = "AEIOUaeiou"; while (scanf("%c", &c) != EOF) { if (is_exsit(c, str)) { printf("Vowel\n"); } else { printf("Consonant\n"); break; } getchar(); } return 0; }
点赞 回复 分享
发布于 2023-10-24 16:43 湖北

相关推荐

找工作勤劳小蜜蜂:矛盾是没有实习,就是没实战经验,公司不想要,公司不要,你就没有实习,你就进入死循环,另外你的项目不是社会现在有大量岗位存在行业用的,云存储人员早就饱和。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务