Problem Description
Tomorrow will be the English exam, Wowapps is Midnight Oil recite the words. Wowapps found the word difficult to recite, the back one forget. After careful study, Wowapps found that the reason why the word is difficult to recite is because of the appearance of a character, destroying the beauty of the whole word, resulting in poor memory. Wowapps decided to destroy these discordant characters on behalf of the Moon!! (Applause!!) But the exam has entered the countdown, and Wowapps decided to give you this glorious and arduous task!! (Warm applause!!) )
Input
Give an n that represents the number of words on the Wowapps (1<=n<=10086)
Next n lines, one word per line, word length not greater than 73, then a space, followed by a character C, represents the discordant character of the word.
Output
Output n lines, one word per line, indicating the word after the discordant character is removed.
Sample Input
1sljfsladoasjflajfodsija s
Sample Output
Ljfladoajflajfodija
1#include <stdio.h>2 intMain ()3 {4 Chars[ About],c;5 intN;6 while(SCANF ("%d", &n)! =EOF)7 {8 for(intk=0; k<n;k++)9 {Tenscanf"%s%c",s,&c); One intI=0, j=0; A for(; s[i]!=' /'; i++) - if(s[i]!=c) -s[j++]=S[i]; thes[j]=' /'; -printf"%s\n", s); - } - + } - + A return 1; at}
Wuhan University of Science and Technology acm:1002: Chinese Edition C language Programming tutorial (second Edition) example 6.6