Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement