zoukankan      html  css  js  c++  java
  • A-B

    本题要求你计算AB。不过麻烦的是,A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉,剩下的字符组成的就是字符串AB。

    输入格式:

    输入在2行中先后给出字符串A和B。两字符串的长度都不超过1,并且保证每个字符串都是由可见的ASCII码和空白字符组成,最后以换行符结束。

    输出格式:

    在一行中打印出AB的结果字符串。

    输入样例:

    I love GPLT!  It's a fun game!
    aeiou
    

    输出样例:

    I lv GPLT!  It's  fn gm!
    代码:
    #include <iostream>
    #include <cstdio>
    using namespace std;
    
    string s,t;
    bool tag[200];
    int main() {
        getline(cin,s);
        getline(cin,t);
        for(int i = 0;i < t.size();i ++) {
            tag[t[i]] = true;
        }
        for(int i = 0;i < s.size();i ++) {
            if(!tag[s[i]]) putchar(s[i]);
        }
    }
  • 相关阅读:
    go-go协程
    linux-pclint代码检测
    linux-32位-交叉编译openssl
    go-json类
    mysql-定时任务
    go-IO操作
    go-异常处理-error-panic-recover
    go-defer语句
    go-select
    go-指针
  • 原文地址:https://www.cnblogs.com/8023spz/p/10607691.html
Copyright © 2011-2022 走看看