View Code of Problem 55

#include<iostream>
#include<string>
using namespace std;
int main()
{
	string str;
	char c;
	char a[100];
	int j = 0;
	cin >> str;
	cin >> c;
	for (int i = 0; i < str.size(); i++) {
		if (str[i] != c) {
			a[j] = str[i];
			j++;
		}
	}
	for (int i = 0; i < j; i++) {
		cout << a[i];
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 55