博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1084 Broken Keyboard (20 分)
阅读量:4588 次
发布时间:2019-06-09

本文共 1658 字,大约阅读时间需要 5 分钟。

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

 

分析:注意字符串结尾是string::npos, 7行搞定!

1 /** 2 * Copyright(c) 3 * All rights reserved. 4 * Author : Mered1th 5 * Date : 2019-02-25-19.55.33 6 * Description : A1084 7 */ 8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 #include
15 #include
16 #include
17 #include
18 #include
19 using namespace std;20 int main(){21 #ifdef ONLINE_JUDGE22 #else23 freopen("1.txt", "r", stdin);24 #endif25 string s1,s2,ans="";26 cin>>s1>>s2;27 for(int i=0;i

 

转载于:https://www.cnblogs.com/Mered1th/p/10433170.html

你可能感兴趣的文章
内部类详解(很详细)
查看>>
dubbox系列【三】——简单的dubbox提供者+消费者示例
查看>>
常见sql 写法总结
查看>>
Windows xp搭建Windows Phone 7开发环境
查看>>
[bzoj] 1597 土地购买 || 斜率优化dp
查看>>
Lodop的JS模版代码、文档式模版 生成加载赋值博文索引
查看>>
Python安装和开发环境搭建
查看>>
[USACO4.2] 草地排水 Drainage Ditches (最大流)
查看>>
dotnetcore+vue+elementUI 前后端分离 三(前端篇)
查看>>
gdb输入输出重定向
查看>>
包含.h就可以用其对应的函数
查看>>
mysql忘记root密码的处理方法
查看>>
Newtonsoft.Json之JArray, JObject, JProperty,JValue
查看>>
OO Summary (Homework 9-11)
查看>>
fedora 解决yumBackend.py进程CPU占用过高
查看>>
NTP 协议介绍
查看>>
软件测试 · 白盒测试
查看>>
docker-compose exec时出现"fork/exec /proc/self/exe: no such file or directory" 报错
查看>>
IIS的安装及网站发布的图解
查看>>
VM虚拟机安装苹果雪豹操作系统
查看>>