Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- #include<fstream>
- using namespace std;
- ifstream fin1("x.txt.cpp");
- char s[4][20];
- int main()
- {
- int i,j;
- for(i=1;i<=4;i++) cin>>s[i];
- for(i=1;i<=4;i++)
- {
- for(j=i+1;j<=4;j++)
- {
- if(strstr(s[i],s[j])!=0)
- {
- cout<<s[i]<<" "<<s[j];
- cout<<endl;
- }
- if(strstr(s[j],s[i])!=0)
- {
- cout<<s[j]<<" "<<s[i];
- cout<<endl;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment