Submission

Status:
[P-SSSSSS]

Score: 0

User: whatisdp

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

Language: cpp

Time: 0.002 second

Submitted On: 2024-11-10 10:31:33

#include<bits/stdc++.h>
using namespace std;
int main() {
	cin.tie(0)->sync_with_stdio(false);
	map<char,int> mc;
	char s1[20],s2[20];
	cin.getline(s1,20);
	cin.getline(s2,20);
	for(auto &x:s1) {
		mc[x]=1;
	}
	for(auto &x:s2) {
		if (mc[x]==1) mc[x]=2;
	}
	for(auto &x:mc) {
		if (x.second==2) cout<<x.first<<' ';
	}
}