View Code of Problem 55

#include <iostream>
#include <string.h>
int main()
{
char str[100];
char str1[100];
gets(str);
int len=strlen(str);
char c;
int j=0;
scanf("%c",&c);
    for (int i = 0; i <len; ++i) {
        if(str[i]!=c)
        {
            str1[j++]=str[i];
        }
    }

    for (int k = 0; k <j; ++k) {
        printf("%c",str1[k]);
    }
    return 0;

}

Double click to view unformatted code.


Back to problem 55