View Code of Problem 55

#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
char str[110],c;
int j=0;
int main(){
	gets(str);
	c=getchar();
	for(int i=0;i<strlen(str);i++){
		if(str[i]!=c)
			str[j++]=str[i];
	}
	str[j]='\0';
	cout<<str;
	return 0;
}

Double click to view unformatted code.


Back to problem 55