SelinD

75

Jun 28th, 2019
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. #include<fstream>
  4. using namespace std;
  5. ifstream fin1("x.txt.cpp");
  6. char s[4][20];
  7. int main()
  8. {
  9. int i,j;
  10. for(i=1;i<=4;i++) cin>>s[i];
  11.  
  12. for(i=1;i<=4;i++)
  13. {
  14. for(j=i+1;j<=4;j++)
  15. {
  16. if(strstr(s[i],s[j])!=0)
  17. {
  18. cout<<s[i]<<" "<<s[j];
  19. cout<<endl;
  20.  
  21. }
  22. if(strstr(s[j],s[i])!=0)
  23. {
  24. cout<<s[j]<<" "<<s[i];
  25. cout<<endl;
  26.  
  27. }
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment