不知道为什么运行不出来
#include <stdio.h>
int isvowel(char c)
{int is;
switch(c)
{case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
is=1;
break;
default:is=0;
}
return is;
}
利用switch语句判断给定的字符是否为元音字符(a,e,i,o,u)
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
南七灵 2021-11-14 21:44关注#include <stdio.h> int isvowel(char c) { int is; switch (c) { case 'a': case 'e': case 'i': case 'o': case 'u': is = 1; break; default: is = 0; } return is; } int main(){ char c; scanf("%c", &c); printf("%d", isvowel(c)); }
大概就是这样,输入元音字母返回1本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报