Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: nattawin

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-05 15:25:08

#include<bits/stdc++.h>
using namespace std;

int main() 
{
	string ap,word;
	set<char> s;
	cin>>ap>>word;
	for(int i = 0; i < ap.size() ; i++)
	{
		for(int j = 0; j < word.size() ; j++)
		{
			if(ap[i]==word[j])
			{
				s.insert(ap[i]);
			}
		}
	}
	for(char x : s)
	{
		cout<<x<<" ";
	}

}