Submission
Status:
[PPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: korn234
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.004 second
Submitted On: 2026-09-20 09:56:18
#include <iostream>
using namespace std;
int main(){
string a;
string b;
int countA[128]={0};
int countB[129]={0};
cin>>a>>b;
for (int i=0; i<a.length(); i++){
countA[a[i]]++;
}
for (int i=0; i<b.length(); i++){
countB[b[i]]++;
}
for (char c='A'; c<='Z'; c++){
if (countA[c]>0 && countB[c]>0){
cout<<c<<" ";
}
}
for (char c='a'; c<='z'; c++){
if (countA[c]>0 && countB[c]>0){
cout<<c<<" ";
}
}
}