Submission
Status:
[PPPPPPPP]
Score: 100
User: detectives_conan
Problemset: สตริงซ้ำซ้ำ
Language: cpp
Time: 0.001 second
Submitted On: 2024-11-11 01:02:44
#include <stdio.h>
#include <string.h>
int main(){
char a[200], b[200];
int mp[200] = {0};
scanf("%s %s", a, b);
for(int i = 0; i < strlen(a); ++i) if(!mp[a[i]]) mp[a[i]]++;
for(int i = 0; i < strlen(b); ++i) if(mp[b[i]] == 1) mp[b[i]]++;
for(char i = 'A'; i <= 'Z'; ++i) if(mp[i] == 2) printf("%c ", i);
for(char i = 'a'; i <= 'z'; ++i) if(mp[i] == 2) printf("%c ", i);
}