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