ZJU-PAT 1050
2013-03-24 22:04
381 查看
#include<iostream> #include<string> using namespace std; /* Sample Input: They are students. aeiou Sample Output: Thy r stdnts. */ bool myhash[150]; string s1,s2; void run() { getline(cin,s2); int i; string s=""; int len=s1.size(); int len2=s2.size(); for(i=0;i<150;i++) myhash[i]=0; for(i=0;i<len2;i++) { myhash[s2[i]]=1; } for(i=0;i<len;i++) { if(myhash[s1[i]]==0) s+=s1[i]; } cout<<s<<endl; } int main() { while(getline(cin,s1)) run(); return 0; }
PAT 1050:String Subtraction
利用ascii表的哈希去重
相关文章推荐
- EASY_ZJU_PAT_ADVANCED LEVEL 1050 高效输入含有空格的字符串 高效删除字符串中的字符
- PAT乙级 1050. 螺旋矩阵(25)
- PAT乙级1050. 螺旋矩阵(25)
- PAT (Basic Level) Practise (中文)1050. 螺旋矩阵(25)
- 2-06. 数列求和(20)(ZJUPAT 数学)
- PAT-B 1050. 螺旋矩阵
- PAT 1050 String Subtraction
- 7-05. 魔法优惠券(25) (数学 ZJU_PAT)
- PAT-B 1050.螺旋矩阵
- 2-07. 素因子分解(20) (ZJUPAT 数学)
- pat乙级真题 1050. 螺旋矩阵(25)
- http://pat.zju.edu.cn/contests/pat-practise/1020
- PAT 1050 Course List for Student (25)(选课)
- ZJU PAT 1012 The Best Rank
- ZJU PAT 1012 The Best Rank
- 1050. 螺旋矩阵(25) PAT
- zju pat 1015
- ZJU PAT 1013 数素数
- PAT 1050. 螺旋矩阵(25)
- 5-05. QQ帐户的申请与登陆(25)(map运用)(ZJU_PAT)