1050. String Subtraction (20)
来源:互联网 发布:linux avi转rmvb 编辑:程序博客网 时间:2024/06/07 14:42
1050. String Subtraction (20)
时间限制
100 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
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 <iostream>#include <cstdio>#include <cstdlib>#include <algorithm>#include <cstring>#include <queue>#include <stack>using namespace std;int book[10000]={0};int main(){ freopen("in.txt","r",stdin); char a[11000]; char b[11000]; gets(a);//读入带空格的字符串 gets(b); int len1=strlen(a);//strlen获取字符串长度 int len2=strlen(b); int i; cout<<len1<<' '<<len2; /* for(i=0;i<len2;i++) { int t; t=b[i]; book[t]=1; } for(i=0;i<len1;i++) { int t2; t2=a[i]; if(book[t2]==1) { continue; } else { printf("%c",a[i]); } } */ return 0;}
阅读全文
0 0
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- 1050. String Subtraction (20)
- linux下安装hadoop分布式文件系统hdfs
- Node JS体系架构
- vyos
- [视频]AI 机器学习 深度学习 视频教程汇总
- 数据库的集合运算(表的加减法和联结)
- 1050. String Subtraction (20)
- Android开发 之 OpenGL ES系列(5--3D立体图形)
- 5C-codeforce Longest Regular Bracket Sequence
- 【XSY2470】lcm 数学
- 使用dtc将dtb反编译成dts
- LaTex技巧(四):如何很好的输入化学公式?
- 从零开始的"E"世界(J2SE)
- 0.1 用代码画画——搞艺术的学编程有啥用?
- PE文件检测DOS头\NT头