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. 使用Spring的Property文件存储测试数据 - 初始化

    本系列博客有一个前提:只使用Junit编写测试,不使用类似Cucumber这类BDD框架. 用Cucumber的时候,测试数据可以直接写在feature文件里,但是仅仅使用Junit(不要问我为什么只 ...

  2. 怎样用CODESOFT打印连续的条码标签?

    在实际工作中,经常会用CODESOFT条 码打印软件来实现打印连续的条码标签,将这些标签按递增或递减等方式连续打印.这样设置可大大提高用户的工作效率.实现在CODESOFT 2015打印连续条码标签, ...

  3. 【LeetCode】84. Largest Rectangle in Histogram

    Largest Rectangle in Histogram Given n non-negative integers representing the histogram's bar height ...

  4. Refs to Components

    一.ref是通过ReactDOM.render返回的 定义在组件上的render方法返回的是一个虚拟的DOM节点,jsx返回的是一个ReactElement,ReactDOM.render返回的是一个 ...

  5. 使用Flex4的PopUpManager的addPopUp() 方法弹出 removeChild异常的解决办法

    Flex4中,弹出窗口有两种: Alert.show("balabalabala-");   PopUpManager.addPopUp([要弹出的控件],[父控件],[是否模态] ...

  6. CSS3之动画相关

    CSS3动画相关的属性:transform,transition,animation. 变形Transform 语法: transform: rotate | scale | skew | trans ...

  7. ansible 变更内网服务器配置

    https://serversforhackers.com/tag/ansible http://docs.ansible.com/ansible/developing_api.html https: ...

  8. if [-f build/core/envsetup.mk -a -f Makefile ]; then

    这个语法是什么意思?

  9. PO、BO、VO、DTO、POJO、DAO的区别

    PO: 基本上就是Entity了 persistant object持久对象 最形象的理解就是一个PO就是数据库中的一条记录. 好处是可以把一条记录作为一个对象处理,可以方便的转为其它对象. ---- ...

  10. Hive[1] 初识 及 安装

    本文前提是Hadoop & Java & mysql 数据库,已经安装配置好,并且 环境变量均已经配置到位   声明:本笔记参照 学习<Hive 编程指南>而来,如果有错误 ...