Submission
Status:
[PPPPP-SS]
Subtask/Task Score:
{0/100}
Score: 0
User: chs_14
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.005 second
Submitted On: 2025-12-08 09:43:44
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
string strmin, strmax;
{
string str1, str2;
cin >> str1 >> str2;
if(str1.size()>str2.size()) {
strmax = str1;
strmin = str2;
}
else {
strmax = str2;
strmin = str1;
}
}
for (char &c : strmin)
{
for (char &d : strmax)
{
if (c==d) {
cout << c << ' ';
break;
}
}
}
}