Programming Ability Test study 1029. Old keyboards (20)

Source: Internet
Author: User

1029. Old keyboard (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, 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

Submit Code

#include <iostream>#include<cstdio>#include<cmath>#include<cstdlib>#include<cstring>#include<string>#include<algorithm>#defineMAXSIZE 100005using namespacestd;Char*divide (Char*a) {    intleng=strlen (a);  for(intI=0; i<leng;i++)//lowercase becomes uppercase    {        if(a[i]>='a'&&a[i]<='Z') A[i]=(Char) (A[i]-('a'-'A')); }    intaa[ -]={0};  for(intj=0; j<leng;j++)    {        if(aa[a[j]]!=0) a[j]='*'; AA[A[J]]++; }    /*for (int j=1;j<leng;j++) {for (int i=0;i<j;i++) {if (A[j]==a[i]) a[j]= ' * '; }    }*/    returnA;} voidRead (Char*SST,Char*sst1) {    inta[ -]={0};  for(intI=0; sst1[i];i++) {A[sst1[i]-0]=1; }     for(intI=0; sst[i];i++)    {        if(a[sst[i]-0]==1) sst[i]='*'; }    intj=0;  while(sst[j]!=' /')    {        if(sst[j]!='*') cout<<Sst[j]; J++; } cout<<Endl; }intMain () {Charss[ +];Charss1[ +];    Gets (ss); Char*sst=Divide (ss); //cout<<sst<<endl;gets (SS1); Char*sst1=Divide (SS1); //cout<<sst1<<endl; //Cout<<strlen (SST) << "<<strlen" (sst1) <<endl;Read (SST,SST1); return 0;} 
View Code

Programming Ability Test study 1029. Old keyboards (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.