Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- bool a1[256],a2[256];
- int main() {
- string s1,s2;
- cin>>s1>>s2;
- for (int i = 0; i < s1.size(); i++){
- a1[(int)s1[i]] = true;
- }
- for (int i = 0; i < s2.size();i++){
- a2[(int)s2[i]] = true;
- }
- for (int i = 0; i < 256;i++){
- if (a1[i] && a2[i]){
- cout<< (char)i;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement