/*
【VB程序设计-Exbc707】
7、编写函数,其功能是从字符串中查找指定的字符并且将其删除,若未找到则不删除。在主函数中输入字符串及指定字符,调用函数完成相应功能后在主函数中输出结果。
【输入输出示例】
I am a student.I am learning program c. ↙
I↙
str= am a student. am learning program c.
*/
#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[])
{
static char sentence[99];
gets(sentence);
char word;
scanf("%c",&word);
void select(char a[],char b);
select(sentence,word);
puts(sentence);
return 0;
}
void select(char a[],char c)
{
for (int i = 0; i<strlen(a);)
{
if (a[i]==c)
{
for (int j = 0; j < strlen(a); ++j)
{
a[j]=a[j+1];
}
}
++i;
}
}