View Code of Problem 55

#include <iostream>
//#include<stdio.h>
#include<string.h>

int main(int argc, char** argv) {
	char str[85];
	gets(str);
	
	char c ;
	scanf("%c" , &c);
	
	int i = 0, j = 0 ;

	int length = strlen(str);
	
		
	for(i = 0 ; str[i]!='\0' ; i++){
		if(str[i] != c){
			str[j++] = str[i];
		}else{
			length--;
		}
	}
	str[j] = '\0';
	puts(str);
	return 0;
}






Double click to view unformatted code.


Back to problem 55