SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. { char a[20], b[20];
  8. int i,j,k;
  9. cin>>a>>b;
  10. for (i=0;j<=strlen(a);i++)
  11.     for(j=0;j<=strlen(b);j++)
  12.     if(a[i]==b[i])
  13.     cout<<a[i]<<" ";
  14.  
  15.  
  16.     cout<<endl;
  17.     for(i=0;i<=strlen(a);i++)
  18.     {
  19.         k=0;
  20.         for(j=0;j<=strlen(a);j++)
  21.             if(a[i]==b[j])
  22.             k++;
  23.         if(k==0)
  24.             cout<<a[i]<<" ";
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top