View Code of Problem 55

#include <stdio.h> 
#include <string.h>
int main()
{
	char ch[1000],c;
	gets(ch);
	c = getchar();
	int len,i;
	len = strlen(ch);
	for(i=len-1;i>=0;--i)
	{
		if(ch[i] == c)
		{
			for(int j=i;j<len;++j)
			{
				ch[j] = ch[j+1];
			}
		}
	}
	puts(ch);
	return 0;
}

Double click to view unformatted code.


Back to problem 55