#include
#include
#define MAX_LEN 200
void delCharArray(char [], char);
void delCharPtr(char *, char);
int main(void)
{
char str[MAX_LEN], a;
char s1[MAX_LEN], s2[MAX_LEN];
gets(str);
a = getchar();
strcpy(s1, str);
strcpy(s2, str);
delCharArray(s1, a);
delCharPtr(&s2[0], a);
printf("%s\n%s\n", s1, s2);
}
void delCharArray(char str[], char ch)
{
char tmp[MAX_LEN];
int i, j;
for (i=j=0; str[i]!=NULL; i++)
if (str[i] != ch)
tmp[j++] = str[i];
tmp[j] = NULL;
strcpy(str, tmp);
}
void delCharPtr(char *str, char ch)
{
int len = strlen(str);
char *tmp = (char *)malloc(len+1);
char *sv = tmp;
while (*str != NULL)
{
if (*str != ch)
*tmp++ = *str;
str++;
}
*tmp = NULL;
strcpy(str-len, sv);
free(sv);
}