Wuhan University of Science and Technology acm:1002: Chinese Edition C language Programming tutorial (second Edition) example 6.6

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.