1033 旧键盘打字 (20 分)

时间:2021-02-19 13:11:20   收藏:0   阅读:0

兄弟题1084 Broken Keyboard (20 分),一样的水~。

ps:`当按键都没坏的时候,输入可能为空,要用getline而不能用cin。

bool vis[200];
string a,b;

int main()
{
    getline(cin,a);
    getline(cin,b);
    
    for(auto t:a) vis[t]=true;
    for(auto t:b)
        if(isupper(t) && vis[‘+‘])
            continue;
        else if(!vis[toupper(t)])
            cout<<t;
    cout<<endl;
    //system("pause");
    return 0;
}
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!