Submission
Status:
[PPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: nik121416
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-07 23:36:57
#include <iostream>
#include <set>
using namespace std;
int main(){
string str1;
string str2;
set<char> s1;
set<char> s2;
cin >> str1 >> str2;
for(int i = 0;i<str1.length();i++){
s1.insert(str1[i]);
}
for(int i = 0;i<str2.length();i++){
s2.insert(str2[i]);
}
for(char i :s1){
for(char j :s2){
if(j == i){
cout<< j<< " ";
}
}
}
}