Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: sulinx

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-24 00:37:34

#include <bits/stdc++.h>

using namespace std;

int main(){
    string str1,str2;
    int x[150] = {0};
    cin >> str1 >> str2;
    for(int i = 0;i<str1.length();i++){
        for(int j = 0;j<str2.length();j++){
            if(str1[i] == str2[j]){
                if(x[str1[i]] == 0){
                cout << str1[i] << " ";
                x[str1[i]]++;
                }
            }
        }
    }
}