Advertisement
catalyn

//se citesc 2 cuv,afisati toate caracterele primului cuv ce

Feb 26th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. //se citesc 2 cuv,afisati toate caracterele primului cuv ce se gasesc in al doilea
  2. #include <iostream>
  3. #include<cstring>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. char s1[256],s2[256],*p;
  10. int i;
  11. cin.getline (s1,256);
  12. cin.getline(s2,256);
  13. p=strpbrk(s1,s2);
  14. while(p)
  15. {
  16. cout<<p[0];
  17. p++;
  18. p=strpbrk(p,s2);
  19. }
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement