pat-basic-1029-Old keyboard

Source: Internet
Author: User

The old keyboard has broken a few keys, so when you hit a piece of text, the corresponding characters will not appear. Now give the text that should be entered, and the text that is actually entered, please list those keys that must be broken.

Input format:

Enter the text that should be entered in 2 rows, and the text that is actually entered. Each paragraph of text is a string of no more than 80 characters, consisting of a A-Z (including large, lowercase), number 0-9, and an underscore "_" (for spaces). The title guarantees that 2 strings are not NULL.

Output format:

Output the broken key in a row in the Order of discovery. Where the English letters only output uppercase, each bad key output only once. The title guarantees that there are at least 1 bad keys.

Input Sample:

7_this_is_a_test_hs_s_a_es

Sample output:

7TI

When the SRC string is not in the Des string, it is the corresponding bad key.
Record a bad key with a map

#include <bits/stdc++.h>using namespacestd;stringsrc, des;intlensrc, Lendes;map<Char,BOOL>chtable;intMain () {CIN>>src; LENSRC=src.length (); CIN>>des; Lendes=des.length (); inti =0, j =0;  while(I <lensrc) {        if(Src[i]! =Des[j]) {            if(IsDigit (Src[i])) {if(!Chtable[src[i]]) {//cout << src[i];printf"%c", Src[i]); Chtable[src[i]]=true; }            }            Else{                if(!Chtable[toupper (Src[i])) {//cout << toupper (Src[i]);printf"%c", ToUpper (Src[i])); Chtable[toupper (Src[i])=true; }            }            ++i; }        Else{            ++i; ++J; }    }    return 0;}
Capouis ' CODE

pat-basic-1029-Old keyboard

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.