Reading Strings From Two Files

So basically I have to open two files. The files have the following content:
File1.txt File2.txt
1r Orange 9k Apple
2b yes 5c no
3d black 28o white
4a cat 4a dog
5c

Now, what I have to do is to open and read File1.txt and if the string is found in File2.txt, then the output should print the entire line from File2.txt.
The output should look something like this:
Output:
yes 5c no
cat 4a dog


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <fstream> 
#include <iostream>
#include <string>
using namespace std; 
int main( ) 

{    
    ifstream fin("File1.txt"); 
    ifstream fin1("File2.txt");
    ofstream fout("output.txt");
    
    string line,line1;
    while ((!fin.eof()) && (!fin1.eof())) { 
        getline (fin, line);
        getline (fin1, line1);     
        if(line.find(line1)){ //if the string in File1 is found is File2 
        fout << line1 << "\n";//print those particular lines
        }       
    }
    fin.close();
    fin1.close();  
    fout.close();     

 system("pause");
 return 0;
}


The problem i'm having is that the output im getting is the entire File2.txt and I'm not sure whether the problem comes from the if statement or the way that the while loop is structured or maybe something that I haven't thought of. Any help/suggestion would be really appreciated.

Sorry the contents of the files aren't clear.
File1.txt:
1r
2b
3d
4a
5c

File2.txt:
Orange 9k Apple
yes 5c no
black 28o white
cat 4a dog
Topic archived. No new replies allowed.