PAT A1050. String Subtraction (20)
来源:互联网 发布:智慧树网络课程登陆 编辑:程序博客网 时间:2024/05/21 09:31
Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1 - S2 for any given strings. However, it might not be that simple to do it fast.
Input Specification:
Each input file contains one test case. Each case consists of two lines which gives S1 and S2, respectively. The string lengths of both strings are no more than 104. It is guaranteed that all the characters are visible ASCII codes and white space, and a new line character signals the end of a string.
Output Specification:
For each test case, print S1 - S2 in one line.
Sample Input:They are students.aeiouSample Output:
Thy r stdnts.
#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>#include <map>#include <string>#define Max 20000using namespace std;int main(){int S[300]={0};char s1[Max],s2[Max];gets(s1);gets(s2);int l1=strlen(s1);int l2=strlen(s2);for(int i=0;i<l2;i++){S[s2[i]]=1;}for(int i=0;i<l1;i++){if(S[s1[i]]==1);else printf("%c",s1[i]);} system("pause");return 0;}
0 0
- PAT A1050. String Subtraction (20)
- PAT-A1050. String Subtraction (20)(哈希)
- A1050. String Subtraction (20)
- PAT-String Subtraction (20)
- 1050. String Subtraction (20)-PAT
- PAT 1050 String Subtraction (20)
- PAT 1050. String Subtraction (20)
- PAT 1050. String Subtraction (20)
- pat 1050. String Subtraction (20)
- PAT 1050. String Subtraction (20)
- PAT 1050. String Subtraction (20)
- PAT A 1050. String Subtraction (20)
- 【PAT (Advanced Level)】1050. String Subtraction (20)
- 【PAT甲级】1050. String Subtraction (20)
- 1050. String Subtraction (20) PAT甲级
- PAT(甲级)1050. String Subtraction (20)
- PAT甲级练习1050. String Subtraction (20)
- PAT甲级1050. String Subtraction (20)
- opencv Mat存储在std::vector 时要注意的问题
- Socket 通信原理(Android客户端和服务器以TCP&&UDP方式互通)
- Kubernetes是什么
- UI面板Root-----罗培羽
- CSS3:background-size属性
- PAT A1050. String Subtraction (20)
- ViewPager的addOnPageChangeListener方法详解
- 如何求多个数的最小公倍数
- poj 2488 A Knight's Journey(DFS)
- UI框架之Panel实体类-----罗培羽
- pat a1001
- git 添加文件覆盖文件, 删除文件
- Codeforces Round #254 (Div. 1)C. DZY Loves Colors(线段树经典操作/分块)
- Google guava工具类的介绍和使用