L1-011 两个getline ASCII码在0~255之间

// 这题有点意思了 改来改去的 / 其实一点意思都没有
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 0x3f3f3f3f3f3f3f3f;
#define show(a) cout<<#a<<" = "<<a<<endl
#define show2(b,c) cout<<#b<<" = "<<b<<" "<<#c<<" = "<<c<<endl
#define show3(a,b,c) cout<<#a<<" = "<<a<<" "<<#b<<" = "<<b<<" "<<#c<<" = "<<c<<endl
#define show4(a,b,c,d) cout<<#a<<" = "<<a<<" "<<#b<<" = "<<b<<" "<<#c<<" = "<<c<<" "<<#d<<" = "<<d<<endl
const int maxn = 10005;
#define LOCAL

int main() {
	cin.tie(0);ios::sync_with_stdio(false);
	string s, ss;

	getline(cin, s);
	getline(cin, ss); // //cin >> ss;!!!!!!!!!!!!!!!
	int lens = s.size();
	int lenss = ss.size();
	int f[256] = {0}; // ASCII码在0~255之间

	for(int i = 0; i < lenss; i++)
		f[ss[i]] = 1;

	for(int i = 0; i < lens; i++) {
		if( !f[s[i]])
			cout << s[i];
	}
	cout << endl;
}
/*
	string str ("This is an example phrase.");
    string::iterator it;

    //第(1)种方法
    str.erase (10,8);
    cout << str << endl;        // "This is an phrase."

    //第(2)种方法
    it=str.begin()+9;
    str.erase (it);
    cout << str << endl;        // "This is a phrase."

    //第(3)种方法
    str.erase (str.begin()+5, str.end()-7);
    cout << str << endl;        // "This phrase."
*/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值