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 ...
随机推荐
- Android系统下检测Wifi连接互联网是否正常的代码
/** * * 判断网络状态是否可用 * * @return true: 网络可用 ; false: 网络不可用 */ public boolean isConnectInternet ...
- 解决error C2059: 语法错误:“::”问题
错误代码提示: >f:\opencv\opencv\build\include\opencv2\flann\lsh_table.h(): error C2059: 语法错误:“::”f:\ope ...
- Orchard官方文档翻译(九) 新增并管理媒体资源
原文地址:http://docs.orchardproject.net/Documentation/Adding-and-managing-media-content 想要查看文档目录请用力点击这里 ...
- 操作系统是怎么工作的——mykernel环境的搭建
可以参见:https://github.com/mengning/mykernel 首先感谢:http://www.euryugasaki.com/archives/1014 1.搭建实验环境(实验环 ...
- js实现简单的滑动门和tab选项卡
思想:首先定义三个选项卡,可以用任何标签,只要如下图, 一共有三个ul,第一个ul给一个class,因为默认第一个选项卡的内容显示出来, 其他两个ul display:none: 当我鼠标移到第二个 ...
- 关于oracle中传过来的一个多id需要插入到数据库用,分格的存储过程
create or replace procedure test ( jf_Id in nvarchar2, yf_id in nvarchar2 ) as v_length NUMBER := LE ...
- VC 运行时库 /MD、/MDd 和 /MT、/MTd
这里总结下他们的区别,后面的那个'd'是代表DEBUG版本,没有'd'的就是RELEASE版本了. 首先说/MT /MT是 "multithread, static version ” 意思 ...
- C++: std::string 与 Unicode 结合
一旦知道 TCHAR 和_T 是如何工作的,那么这个问题很简单.基本思想是 TCHAR 要么是char,要么是 wchar_t,这取决于_UNICODE 的值: // abridged from tc ...
- iOS开发中view controller设置问题
- hdu2571
if(x==1) f(x,y)=max{f(x,y-1),f(x,z)} {y%z==0&&1<y/z<=y&&1<=z<<y} els ...