#include <stdio.h> #include <math.h> #include <string.h> int main(int argc, const char * argv[]) { char str[101], c, str1[101]; int i, j = 0; gets(str); scanf("%c", &c); for(i = 0; str[i] != '\0'; i++) { if(c != str[i]) { str1[j++] = str[i]; } } str1[j] = '\0'; puts(str1); } |
Double click to view unformatted code.