1084. Broken Keyboard (20)
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)的更多相关文章
- 1084. Broken Keyboard (20)【字符串操作】——PAT (Advanced Level) Practise
题目信息 1084. Broken Keyboard (20) 时间限制200 ms 内存限制65536 kB 代码长度限制16000 B On a broken keyboard, some of ...
- 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 ...
- PAT (Advanced Level) 1084. Broken Keyboard (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
- 1084. Broken Keyboard (20)-水题
#include <iostream> #include <cstdio> #include <string.h> #include <algorithm&g ...
- 【PAT甲级】1084 Broken Keyboard (20 分)
题意: 输入两行字符串,输出第一行有而第二行没有的字符(对大小写不敏感且全部以大写输出). AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #inclu ...
- PAT 1084 Broken Keyboard
1084 Broken Keyboard (20 分) On a broken keyboard, some of the keys are worn out. So when you type ...
- pat1084. Broken Keyboard (20)
1084. Broken Keyboard (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue On a ...
- 1084 Broken Keyboard (20 分)
1084 Broken Keyboard (20 分) On a broken keyboard, some of the keys are worn out. So when you type so ...
- 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 ...
随机推荐
- 从AlphaGo谈通用型人工智能设计
最近赢了人机大战的AlphaGo火了,火得一塌糊涂,圈里圈外,是人都在谈AlphaGo.但是AlphaGo毕竟是为特定场景特定应用设计的特定型人工智能,和通用型人工智能还是有很大差别,离人工智能普及更 ...
- vc不用IDE编译方法
一个EXE是如何形成的 比如一个源程序有以下两个文件. 1.c 1.rc 首先cl.exe 会把源代码编译为1.obj rc.exe会把1.rc编译为1.res link.exe会把1.obj 1.r ...
- win7突然无法启动(以前可以启动的,电脑是ubuntu+win7双系统)
这里 有个解决办法是将win7的menuentry里的chainloader +1改为ntldr /bootmgr,但是这个解决办法是基于把Boot Loader指定在/dev/sda1里了,即win ...
- Ax Lookup Form
Reference: Class\sysLookupTable 1. 用临时表构造Lookup下拉结果,sysLookupTable有一个parmTmpBuffer方法,表明传入展示的结果集是临时表 ...
- Windbg 内存命令 《第四篇》
内存是存储数据.代码的地方,通过内存查看命令可以分析很多问题.相关命令可以分为:内存查看命令和内存统计命令.内存统计命令用来分析内存的使用状况. 一.查看内存 有非常丰富的内存查看命令,它们被容易为d ...
- druid parser
有没有好用的开源sql语法分析器? - 匿名用户的回答 - 知乎 druid parser
- LDAP介绍
摘自: http://www.blogjava.net/allen-zhe/archive/2007/03/19/104740.html LDAP介绍 原文:http://ldapman.org/ar ...
- 修改 Ueditor 默认显示的字体大小
默认字体为16px,有点大,为了美观而且一屏可以显示更多内容,可以修改为12px 打开:ueditor.all.min.js 我用的是压缩版 找到如下代码: body{margin:8px;font- ...
- javaSE第五天
第五天 22 1. 方法(掌握) 22 (1)方法:就是完成特定功能的代码块. 22 (2)格式: 22 (3)两个明确: 23 (4)方法调用 23 (5)案例: ...
- memcached for windows 修改端口和最大内存
解压后只要在命令窗口中输入下面命令c:\memcached\memcached.exe -d install 就可以把memcached安装为windows服务了. 启动该服务后,memcached ...