View Code of Problem 55

#include<stdio.h>
#include<string.h>
int main(){
  char str[100],c;
  int num=0;
  gets(str);
  c=getchar();
  for(int i=0;i<=strlen(str);i++){
    if(str[i]==c) num++;
      else str[i-num]=str[i];
      }
  puts(str);
  return 0;
}

Double click to view unformatted code.


Back to problem 55