1084. Broken Keyboard (20)
来源:互联网 发布:天猫跟淘宝哪个质量好 编辑:程序博客网 时间:2024/06/03 20:49
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_esSample Output:
7TI
#include<iostream>#include<cstring>#include<cstdio>using namespace std;char str1[1000];char str2[1000];char str3[1000];char str4[2]={' ','\0'};int main(){ cin>>str1; cin>>str2; for (int i=0;i<strlen(str1);i++) str1[i]=toupper(str1[i]); for (int i=0;i<strlen(str2);i++) str2[i]=toupper(str2[i]); for (int i=0;i<strlen(str1);i++) { str4[0]=str1[i]; if ((strchr(str2,str1[i])==NULL)&&(strchr(str3,str1[i])==NULL)) { strcat(str3,str4); } } for (int i=0;i<strlen(str3);i++) printf("%c",str3[i]); return 0;}
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- ListControl控件ICON模式
- Uva 340 猜数字的游戏
- oracle 数据字典
- 利用tensorflow 一步一步实现一个简单神经网络,线性回归
- 2017多校第二场 HDU 6050 Funny Function 推公式
- 1084. Broken Keyboard (20)
- 杭电2896(HDU2896)
- html 简单注册页面
- 抽象类Abstract 和接口 Interface
- 关于使用枚举
- DDoS攻击类型
- git配置与使用
- C语言基础之流程控制
- 在html中常用哪几种方式定义css