#include using namespace std; #include "FileReader.h" static void printResults(string title, const set &result) { cout << endl << title << endl; for ( auto &el : result ) { cout << "\t" << el << endl; } } int main(int argc, char* argv[]) { static const char pathsep = '/'; if ( argc != 5 ) { cerr << "Usage: ./ex11 " << endl; cerr << "Tries to read files /.txt and /excluded.txt" << endl; exit(EXIT_FAILURE); } string directory(argv[1]); directory += pathsep; unsigned int top_num = atoi(argv[2]); string genre1(argv[3]); string genre2(argv[4]); FileReader exclusions(directory + "excluded.txt"); FileReader fOne(top_num, directory + genre1 + ".txt", exclusions); FileReader fTwo(top_num, directory + genre2 + ".txt", exclusions); printResults(genre1 + " - " + genre2, (fOne - fTwo).set() ); printResults(genre2 + " - " + genre1, (fTwo - fOne).set() ); printResults(genre1 + " intersect " + genre2, (fTwo ^ fOne).set() ); }