1050. String Subtraction (20)-PAT甲级
来源:互联网 发布:编程就业方向 编辑:程序博客网 时间:2024/06/10 00:35
题目:
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.
aeiou
Sample Output:
Thy r stdnts.
解答:
#include<cstdio>#include<cstring>char a[10005],b[10005];int HashTable[128]={0};int main(){ gets(a); gets(b); int lenA=strlen(a); int lenB=strlen(b); for(int i=0;i<lenB;i++){ HashTable[b[i]]=1; } for(int i=0;i<lenA;i++){ if(HashTable[a[i]]==0){ printf("%c",a[i]); } } return 0;}
- 【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)
- 1050. String Subtraction (20)-PAT甲级
- PAT 甲级 1050. String Subtraction (20)
- PAT甲级 1050. String Subtraction (20)
- 1050. String Subtraction (20)-PAT甲级真题(哈希)
- 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
- PAT 1050. String Subtraction
- 【PAT】1050. String Subtraction
- 关于char以及varchar2在实际使用时的一点经验
- cocopos 安装
- Python爬虫系列之----Scrapy(九)使用CrawlSpider完善豆瓣图书爬虫
- sort函数的用法
- Android开发实践:Java层与Jni层的数组传递
- 1050. String Subtraction (20)-PAT甲级
- 传统CDN加速不给力,来看适合GIS的Geo-CDN
- kubenetes源码分析之DNS(七)
- 2017去哪儿网前端面试心得
- CMAKE 常用指令
- c++中vector的用法详解
- 通过 命令提示符(cmd.exe)连接 Oracle 数据库
- escape(),encodeURI(),encodeURIComponent ajax处理乱码
- shell指令 grep -r