فکر کنم همچین برنامهای میخوای
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
const char *file1 = "a.txt";
const char *file2 = "b.txt";
int main()
{
ifstream in;
in.open(file1, ios::in);
vector<string> lines;
string s;
while(getline(in, s))
lines.push_back(s);
in.close();
in.open(file2, ios::in);
bool *mark = new bool[lines.size()];
memset(mark, false, lines.size());
while(getline(in, s))
for (int i = 0; i < lines.size(); i++)
if (lines[i] == s)
mark[i] = true;
for (int i = 0; i < lines.size(); i++)
if (!mark[i])
cout << "Line " << i + 1 << ": " << lines[i] << endl;
return 0;
}