Submission

Status:

[PPPPPP-S]

Subtask/Task Score:

{0/100}

Score: 0

User: nunos

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-09-28 23:18:33

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string txt1,txt2,result;
    bool st=false;
    cin >> txt1;
    cin >> txt2;
    if(int(txt1[0])>int(txt2[0])) swap(txt1,txt2);
    for(int i=0;i<txt1.size();i++){
        for(int j=0;j<txt2.size();j++){
            if(txt1[i]==txt2[j]) st =true;
        }
        if(st){cout << txt1[i] << " ";st=false;}
    }
    return 0;
}