PAT Broken Keyboard (20)

Source: Internet
Author: User

PAT Broken Keyboard (20)
Description

On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed to type, and the string that you actually type out, please list those keys which are for sure worn out.

Input description:
Each input file contains one test case. For each case, the 1st line contains the original string, and the 2nd line contains the typed-out string. Each string contains no more than 80 characters which are either English letters [A-Z] (case insensitive), digital numbers [0-9], or "_" (representing the space). It is guaranteed that both strings are non-empty.


Output description:
For each test case, print in one line the keys that are worn out, in the order of being detected. The English letters must be capitalized. Each worn out key must be printed once only. It is guaranteed that there is at least one worn out key.

Input example:
7_This_is_a_test_hs_s_a_es

Output example:
7TI


# Include
 
  
# Include
  
   
# Include
   
    
# Include
    
     
Using namespace std; const int MAX = 80; // Remove the repeated character void Remove (char * s, int num) {int I, j, l; I = j = 0; for (I = 0; I
     
      
= J) {s [j ++] = s [I] ;}} s [j] = '\ 0';} // find the 1st strings, there are no characters in the 2nd string, void Worn (char * lhs, char * rhs, char * result) {int I, j, k; k = 0; for (I = 0; lhs [I]! = '\ 0'; I ++) {for (j = 0; rhs [j]! = '\ 0'; j ++) {if (lhs [I] = rhs [j]) break;} if (rhs [j] =' \ 0 ') {result [k ++] = lhs [I] ;}} result [k] = '\ 0';} int main () {int I; string n, m; char sn [MAX], sm [MAX], sr [MAX]; while (cin> n> m) {// converts lowercase English characters in the input string 1 to uppercase English letters for (I = 0; I
      
        = 65) & (sn [I] <= 90) | (sn [I]> = 97) & (sn [I] <= 122 )) sn [I] =: toupper (sn [I]);} sn [I] = '\ 0 '; // converts lowercase English characters in the input string 2 to uppercase English letters for (I = 0; I
       
         = 65) & (sm [I] <= 90) | (sm [I]> = 97) & (sm [I] <= 122 )) sm [I] =: toupper (sm [I]);} sm [I] = '\ 0';/* for (I = 0; sn [I]! = '\ 0'; I ++) cout <
        
       
      
     
    
   
  
 

Related Article

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.