删除字符串中指定的字符:
因比较简单,不多说
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
using namespace std;
void deletechar(char a[],char c)
{
int i,j;
for(i=0,j=0; *(a+i)!='\0'; i++)
{
if(*(a+i)==c)
continue;
else
{
*(a+j)=*(a+i);
j++;
}
}
*(a+j)='\0';
}
int main()
{
char a[100],c;
scanf("%s %c",a,&c);
deletechar(a,c);
printf("%s",a);
return 0;
}