Pat-B-1033. Old keyboard typing (20)

Source: Internet
Author: User

1033. Old keyboard Typing (20) time limit MS Memory limit 65536 KB code length limit 8000 B procedure StandardAuthor Chen, Yue

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, as well as the broken keys, the results of the text will be typed?

Input format:

Enter the keys that were broken in 2 rows, and the text that should be entered. The bad key corresponding to the English letter is given in uppercase, and each paragraph is a string of no more than 105 characters. The available characters are the letters [a-Z, A-z], the number 0-9, and the Underscore "_" (for spaces), ",", ".", "-", "+" (on behalf of the upper file key). The title guarantees that the text string entered in line 2nd is not empty.

Note: If the upper file key is broken, the uppercase English letter cannot be typed.

Output format:

Outputs the result text that can be typed in a row. If no word rp is typed, a blank line is output.

Input Sample:
7+ie.7_this_is_a_test.
Sample output:
_hs_s_a_tst

Idea: ' + ' and ' _ ' are the keys to judging

1#include <bits/stdc++.h>2 using namespacestd;3 intMain ()4 {5     Chara[100010],b[100010];6     intaa[100010]= {0};7 gets (a);8 gets (b);9     intshift=0, blank=0;Ten     intLa=strlen (a); One     intlb=strlen (b); A      for(intI=0; i<la; i++) -     { -aa[a[i]]=1; the         if(Islower (A[i])) -         { -a[i]-= +; -aa[a[i]]=1; +         } -         Else if(Isupper (A[i])) +         { Aa[i]+= +; ataa[a[i]]=1; -  -         } -         if(a[i]=='+') -shift=1; -         if(a[i]=='_') inblank=1; -  to     } +      for(intI=0; i<lb; i++) -     { the         if(Shift) *         { $             if(!isupper (B[i]) &&aa[b[i]]==0)Panax Notoginsengcout<<B[i]; -         } the         Else if(blank) { +             if(b[i]!=' '&&aa[b[i]]==0) Acout<<B[i]; the         } +         Else -         { $             if(aa[b[i]]==0) $cout<<B[i]; -         } -     } the     return 0; -}

Pat-B-1033. Old keyboard typing (20)

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.