Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: The3e

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

Language: cpp

Time: 0.003 second

Submitted On: 2026-09-25 19:54:29

#include <iostream>
#include <string>
using namespace std;

int main() {
    string a, b;
    cin >> a >> b;

    for (int i = 0; i < a.length(); i++) {
        bool f = false;

        for (int j = 0; j < b.length(); j++) {
            if (a[i] == b[j]) {
                f = true;
            }
        }

        if (f) {
            bool al = false;

            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    al = true;
                }
            }

            if (!al) {
                cout << a[i] << " ";
            }
        }
    }

    return 0;
}