Submission
Status:
[-SSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: Phupa
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-07 14:16:17
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str1,str2;
int lon1,lon2,ascii[256]={0},i,j;
cin>>str1>>str2;
lon1 = str1.length();
lon2 = str2.length();
for (i=0;i<lon1;i++)
{
for (j=0;j<256;j++)
{
if (str1[i]==j)
ascii[j] += 1;
}
}
for (i=0;i<lon2;i++)
{
for (j=0;j<256;j++)
{
if (str2[i]==j)
ascii[j] += 1;
}
}
for (i=0;i<256;i++)
if (ascii[i]>1)
cout<<(char)(i)<<" ";
}