例如,输入"Hello,World",输出打印显示 “Hll,Wrld"
#include<stdio.h>
int main()
{
char str[128];
printf("请输入字符串:");
gets_s(str);
char filter[] = "AEIOUaeiou";
printf("过滤后的字符串:");
for (int i = 0; str[i] != 0; i++)
{
int ch = str[i];
int exist = 0;
for (int j = 0; j < 10; j++)
{
if (ch == filter[j])
{
exist = 1;
break;
}
}
//打印
if (!exist)
{
printf("%c", ch);
}
}
return 0;
}