#include<iostream>
#include<assert.h>
using namespace std;
//例如:原始串为:welcome to asted.模式串为:aeiou.
char *fun(char *s)
{
assert(s!= NULL);
int i=0,j=0;
while(s[j] !='\0')
{
while(s[j] == 'a'||s[j]=='e'||s[j]=='i'||s[j]=='o'||s[j]=='u')
j++;
s[i++]=s[j++];
}
return s;
}
void main()
{
char str[]="welcom to asted";
char *p=fun(str);
while(*p !='\0')
cout<<*p++;
}
删除模式串中出现的字符
最新推荐文章于 2022-09-26 00:42:53 发布