L1-011. A-B
来源:互联网 发布:bytefence是什么软件 编辑:程序博客网 时间:2024/04/29 23:23
本题要求你计算A-B。不过麻烦的是,A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉,剩下的字符组成的就是字符串A-B。
输入格式:
输入在2行中先后给出字符串A和B。两字符串的长度都不超过104,并且保证每个字符串都是由可见的ASCII码和空白字符组成,最后以换行符结束。
输出格式:
在一行中打印出A-B的结果字符串。
输入样例:I love GPLT! It's a fun game!aeiou输出样例:
I lv GPLT! It's fn gm!
晕,一直卡在第三个测试点的格式错误上,打开始题意就理解错了,空格符也要减去!!!
#include <iostream>#include<string>/* run this program using the console pauser or add your own getch, system("pause") or input loop */using namespace std;int main(int argc, char** argv) {string a,b;int table[256];getline(cin,a);getline(cin,b);for(int i=0;i<256;i++){table[i]=0;}for(int i=0;i<b.length();i++){//if(b[i]!=32)table[b[i]]=1;}for(int i=0;i<a.length();i++){if(table[a[i]]==0){cout<<a[i];}}return 0;}
0 0
- L1-011.A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- L1-011. A-B
- poj 2492 A Bug's Life(并查集 染色法 二分图)
- 判断线面相交问题
- 4. Median of Two Sorted Arrays
- 5种服务器网络编程模型讲解
- UVA11426:GCD
- L1-011. A-B
- Codeforces Round #396 (Div. 2) C. Mahmoud and a Message 倒着DP
- MySQL学习笔记
- 在红尘的最深处与你相遇
- 修改MySQL的root用户的密码
- CListCtrl控件使用指南(大全)
- Java_jxl读取Excel文件
- 蓝桥杯 算法训练 摆动序列 搜索水题
- hdu 1029 Ignatius and the Princess IV