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 <iostream>
#include <string>
using namespace std;
string str1, str2;
int main()
{
cin >> str1 >> str2;
string res="";
char c;
for (int i = , j = ; i < str1.length(); ++i)
{
while (j < str2.length() && str1[i] == str2[j])
{
++i;
++j;
}
c = toupper(str1[i]);
if (res.find(c) == -)
res += c;
}
cout << res << endl;
return ;
}

PAT甲级——A1084 Broken Keyboard的更多相关文章

  1. A1084. Broken Keyboard

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

  2. PAT 甲级 1112 Stucked Keyboard

    https://pintia.cn/problem-sets/994805342720868352/problems/994805357933608960 On a broken keyboard, ...

  3. PAT甲级——1112 Stucked Keyboard (字符串+stl)

    此文章同步发布在我的CSDN上:https://blog.csdn.net/weixin_44385565/article/details/90041078   1112 Stucked Keyboa ...

  4. PAT甲级——A1112 Stucked Keyboard【20】

    On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the char ...

  5. 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 ...

  6. PAT甲级 1112 Stucked Keyboard

    题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805357933608960 这道题初次写的时候,思路也就是考虑 ...

  7. PAT_A1084#Broken Keyboard

    Source: PAT A1084 Broken Keyboard (20 分) Description: On a broken keyboard, some of the keys are wor ...

  8. PAT甲级题解分类byZlc

    专题一  字符串处理 A1001 Format(20) #include<cstdio> int main () { ]; int a,b,sum; scanf ("%d %d& ...

  9. PAT 1084 Broken Keyboard

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

随机推荐

  1. verifier 调试内存泄露

    没啥技术含量,都是老段子了, 这次记下来,只是我想说,我也做过,留个念相. 前置条件,电脑里面必须得有Verifier,有了之后把自己的驱动加进去, WinDBG上双机,然后就可以跑了,跑一段时间就可 ...

  2. mysql查询小技巧

    如果所传bookTypeName为空则执行select * from t_bookType(搜索框里未输入信息) 否则追加 and bookTypeName like  '%"+bookTy ...

  3. css---8 过渡属性刨析

    1.       transition-property 默认值为 all,表示所有可被动画的属性都表现出过渡动 可以指定多个 property 属性值: none 没有过渡动画. all 所有可被动 ...

  4. 宝塔面板安装swoole扩展

    Swoole是一个PHP扩展,扩展不是为了提升网站的性能,是为了提升网站的开发效率.最少的性能损耗,换取最大的开发效率.利用Swoole扩展,开发一个复杂的Web功能,可以在很短的时间内完成 Swoo ...

  5. 基础数据类型补充 set集合 深浅拷贝

    一.基础数据类型补充 1. "拼接字符串".join(可迭代对象) 可迭代对象为列表时,输出列表元素与拼接字符串的拼接 li = ['张三', '李四', '王五', '赵四'] ...

  6. System.IO.Directory.cs

    ylbtech-System.IO.Directory.cs 1.返回顶部 1. #region 程序集 mscorlib, Version=4.0.0.0, Culture=neutral, Pub ...

  7. TStringList常用操作

    TStringList常用操作 //TStringList 常用方法与属性: var List: TStringList; i: Integer; begin List := TStringList. ...

  8. python环境变量配置 - CSDN博客

    一.下载: 1.官网下载python3.0系列(https://www.python.org/) 2.下载后图标为: 二.安装: Window下: 1.安装路径: 默认安装路径:C:\python35 ...

  9. UNIT对话系统(杂记)

    单轮对话指标: 召回率=机器人能回答的问题数/问题总数 准确率=机器人正确回答的问题数/问题总数 问题解决率=机器成功解决的问题数/问题总数 多轮对话指标: 任务完成率=成功结束的多轮会话数/多轮会话 ...

  10. Java工具类NumberUtils使用

    int数据类型和long数据类型 int占32位,long占64位,long表示的数据更大:public static int toInt(String str) NumberUtils.toInt( ...