PAT(甲级)1050
来源:互联网 发布:java 写html文件 编辑:程序博客网 时间:2024/06/07 10:03
1050. String Subtraction (20)
时间限制
10 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 <cstdio>#include <cstring>#define LENGTH 10004char str1[LENGTH];char str2[LENGTH];bool flag[256];int main(){memset(flag,false,sizeof(bool)*256);gets(str1);gets(str2);char *p=str2;while(*p != '\0'){flag[*p] = true;p++;}int i,j;p=str1;while(*p != '\0'){if(!flag[*p]) putchar(*p);p++;}return 0;}
0 0
- PAT(甲级)1050
- 浙大PAT甲级 1050
- PAT甲级1050
- PAT 甲级
- PAT甲级 A1025.PAT RANKING
- PAT 甲级 1025 PAT Ranking
- PAT(甲级)1003
- PAT(甲级)1004
- PAT(甲级)1005
- PAT(甲级)1006
- PAT(甲级)1007
- PAT(甲级)1008
- PAT(甲级)1009
- PAT(甲级)1010
- PAT(甲级)1011
- PAT(甲级)1012
- PAT(甲级)1013
- PAT(甲级)1014
- leetcode 080 Remove Duplicates from Sorted Array II(难易度:Medium)
- 查找(二)二叉查找数BST
- PAT(甲级)1049
- android读入一个txt文件
- 读写文件的工具类IOUtils 和FileUtils
- PAT(甲级)1050
- javascript闪烁图片
- 关于mysql中文插入 问号??问题的解决方法!
- HDU - 1176 免费馅饼(DP)
- ViewPager防止Fragment销毁以及取消Fragment的预加载
- 大视野2038 小z的袜子 莫队算法
- Light oj 1159 - Batman(三维 LCS)
- sed study
- Java学习之多态