Submission

Status:

[-SSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: Newton4566

Problemset: สตริงซ้ำซ้ำ

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-13 22:50:56

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    string a, b;
    cin >> a >> b;

    char ch[256];
    
    bool first = true;

    for (char c : a) {
        if (b.find(c) != string::npos && !ch[c]) {
            ch[c] = true;
            if (!first) cout << ' ';
            cout << c;
            first = false;
        }
    }

    return 0;
}