Submission

Status:

[PPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: bestisyis...programming

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-07 19:39:16

#include <iostream>
using namespace std;
int main(){
	string sent1,sent2;
	cin >> sent1 >> sent2;
	int a[256]={0};
	for(int i=0;i<sent1.length();i++){
		for(int j=0;j<sent2.length();j++){
			if(sent1[i]==sent2[j]){
				if(a[sent1[i]]==0){
					cout << sent1[i] << ' ';
					a[sent1[i]]++;
				}
			}
		}
	}
}