Submission
Status:
[PPPP-SSS]
Subtask/Task Score:
{0/100}
Score: 0
User: purihorharin
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.002 second
Submitted On: 2026-03-20 19:02:20
#include <iostream>
#include <algorithm>
using namespace std;
int main () {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
string a, b, c;
cin >> a >> b;
for (char ca : a) {
for (char cb : b) {
if (ca == cb) {
c.push_back(cb);
break;
}
}
}
sort(c.begin(), c.end());
for (char cc : c) {
cout << cc << " ";
}
}