solution
#include<iostream>
#include<string>
using namespace std;
const int maxn = 135;
int flag[maxn] = {0};
void printC(string s){
for(int i = 0; i < s.size(); i++){
if(!flag[s[i]]){
cout << s[i];
flag[s[i]] = 1;
}
}
}
int main(){
string a, b;
getline(cin, a);
getline(cin, b);
printC(a);
printC(b);
return 0;
}
or
#include<iostream>
#include<string>
using namespace std;
const int maxn = 135;
int flag[maxn] = {0};
int main(){
string a, b;
getline(cin, a);
getline(cin, b);
a = a + b;
for(int i = 0; i < a.size(); i++){
if(!flag[a[i]]){
cout << a[i];
flag[a[i]] = 1;
}
}
return 0;
}