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 Specification:

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 Specification:

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.

Sample Input:

7_This_is_a_test
_hs_s_a_es

Sample Output:

7TI

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
char a[85],b[85];
int c[200],i,j,l1,l2;
gets(a);
gets(b);
l1=strlen(a);
l2=strlen(b);
memset(c,0,sizeof(c));
for(i=0;i<l2;i++)
{
if(b[i]>='a'&&b[i]<='z')
b[i]-=32;
c[b[i]]++;
}
for(i=0;i<l1;i++)
{
if(a[i]>='a'&&a[i]<='z')
a[i]-=32;
if(c[a[i]]==0)
{
printf("%c",a[i]);
c[a[i]]++;
}

}
printf("\n");
return 0;
}

1084. Broken Keyboard (20)的更多相关文章

  1. 1084. Broken Keyboard (20)【字符串操作】——PAT (Advanced Level) Practise

    题目信息 1084. Broken Keyboard (20) 时间限制200 ms 内存限制65536 kB 代码长度限制16000 B On a broken keyboard, some of ...

  2. PAT Advanced 1084 Broken Keyboard (20) [Hash散列]

    题目 On a broken keyboard, some of the keys are worn out. So when you type some sentences, the charact ...

  3. PAT (Advanced Level) 1084. Broken Keyboard (20)

    简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...

  4. 1084. Broken Keyboard (20)-水题

    #include <iostream> #include <cstdio> #include <string.h> #include <algorithm&g ...

  5. 【PAT甲级】1084 Broken Keyboard (20 分)

    题意: 输入两行字符串,输出第一行有而第二行没有的字符(对大小写不敏感且全部以大写输出). AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #inclu ...

  6. PAT 1084 Broken Keyboard

    1084 Broken Keyboard (20 分)   On a broken keyboard, some of the keys are worn out. So when you type ...

  7. pat1084. Broken Keyboard (20)

    1084. Broken Keyboard (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue On a ...

  8. 1084 Broken Keyboard (20 分)

    1084 Broken Keyboard (20 分) On a broken keyboard, some of the keys are worn out. So when you type so ...

  9. pat 1084 Broken Keyboard(20 分)

    1084 Broken Keyboard(20 分) On a broken keyboard, some of the keys are worn out. So when you type som ...

随机推荐

  1. C# Windows Forms 事件处理顺序

    事件引发的顺序对某些Windows 窗体应用来说十分重要.当某些事件需要特别处理时(如重绘窗体的某些部分),必须知道事件在运行时的确切引发顺序.下面就应用程序和控件的生命周期中的几个重要阶段的事件顺序 ...

  2. 联系博主(推介联系QQ)

    李莫,OI 蒟蒻一只 QQ:740929894 邮箱:12958954@163.com limo740929894@gmail.com (目测国外网站的邮件发不进网易邮箱,所以注册了个Gmail,但是 ...

  3. Java高级软件工程师面试考纲(转)

    如果要应聘高级开发工程师职务,仅仅懂得Java的基础知识是远远不够的,还必须懂得常用数据结构.算法.网络.操作系统等知识.因此本文不会讲解具体的技术,笔者综合自己应聘各大公司的经历,整理了一份大公司对 ...

  4. Android开发-API指南-<application>

    <application> 英文原文:http://developer.android.com/guide/topics/manifest/application-element.html ...

  5. Flex4 自定义分页组件

    自己写的Flex4分页组件,去伪存真,只实现基本的分页功能,数据过滤神马的都不应该是分页组件干的活,有呆毛才有真相: [源代码下载] Flex自从转手给Apache后人气急跌,本人也很捉鸡,尽管Apa ...

  6. vb 取得桌面路径

    txtPath.Text = System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop)

  7. WPF和WINFORM的互操作

    在WPF中使用Winform控件 <Window x:Class="WPFApplication.Window1" xmlns="http://schemas.mi ...

  8. centOS 6.4下安装中文输入法

    1.用root登录 ,或su root 2.yum install "@Chinese Support" 3.exit 4.回到桌面,system->preferences- ...

  9. iConvert Icons 图标转换生成利器,支持Windows, Mac OS X, Linux, iOS,和Android等系统

    这是一款在线图标转换工具,生成的图标支持Windows, Mac OS X, Linux, iOS, 和 Android等主流系统. 可以上传图标文件转化成另一个平台下的图标文件,例如将windows ...

  10. zookeeper学习记录

    ZooKeeper:是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.他主要用来解决分布式应用中的数据管理的一致性问题 ...