Advertisement
Guest User

1

a guest
Aug 10th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <algorithm>
  5. #include <stdlib.h>
  6. #include <string>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.    // freopen("input.txt", "rt", stdin);
  12.     string s1;
  13.     cin>>s1;
  14.     int k=s1.size();
  15.     int c[256];
  16.     int i,j;
  17.     for (j=0;j<256;j++)
  18.         c[j]=0;
  19.     for (i=0;i<k;i++)
  20.         c[int(s1[i])]++;
  21.     for (j=0;j<256;j++)
  22.         if (c[j]==2)
  23.             cout<<char(j);
  24.     return 0;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement