Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: MrPian

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-11 09:03:44

#include<iostream>
#include<string>
using namespace std;
char xx[100];
char yy[100];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string x;
    string y;
    cin >> x >> y;
    for(char c : x){
        xx[static_cast<int>(c - 'A')]++;
    }
    for(char c : y){
        yy[static_cast<int>(c - 'A')]++;
    }

    for (int i = 0; i < 100; ++i) {
        if (xx[i] > 0 && yy[i] > 0) {
            cout << static_cast<char>(i + 'A') << ' ';
        }
    }

return 0;
}