broken keyboard
来源:互联网 发布:stc的16位单片机 编辑:程序博客网 时间:2024/06/04 00:24
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_esSample Output:
7TI
#include<iostream>#include<string>#include<map>#include<vector>using namespace std;int main(){map<char,bool> m;vector<map<char,bool> > v;string s;cin>>s;for(int i=0;i<s.size();i++){m[s[i]]=false;}string s1;cin>>s1;for(int j=0;j<s1.size();j++){m[s1[j]]=true;}vector<char> vv; for(int t=0;t<s.size();t++){if(m[s[t]]==false){if(s[t]<='z'&&s[t]>='a'){char b1=s[t];char b2=b1-32;vv.push_back(b2);}else{vv.push_back(s[t]);} m[s[t]]=true;}}//这里大小写有区分,如何让大小写没有区分?int hash[128]={false}; for(int k=0;k<vv.size();k++){if(hash[vv[k]]==false)cout<<vv[k];hash[vv[k]]=true;} return 0;}
- Broken Keyboard
- Broken Keyboard
- Broken Keyboard
- broken keyboard
- swun Broken Keyboard
- UVA11988 Broken Keyboard
- hdu Broken Keyboard(模拟)
- PAT 1084. Broken Keyboard
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- 1084. Broken Keyboard (20)
- Broken Keyboard SDUTOJ
- 1084. Broken Keyboard (20)
- Uva 11988 Broken Keyboard
- 1084.Broken Keyboard
- uva11988 broken keyboard
- UVA11988 Broken Keyboard 链表
- 1084. Broken Keyboard (20)
- 1.求int类型数据在内存中表示的1的个数
- 逻辑回归(logistic regression)及其Python实现
- 深拷贝与浅拷贝
- Android 中的Dalvik和ART是什么,有啥区别?
- aspx 按钮传值
- broken keyboard
- 【Spring】使用@Service注解写的一个小例子
- 关于cms和crm
- Scala函数式程序设计原理 week4 Types and Pattern Matching
- ffmpeg 使用滤镜
- GitHub使用(四)
- 类的生命周期
- 安卓标签动态加减
- 在数据库中函数和存储过程的区别?