#include #include using namespace std; int main (int argc, char* argv[]) { if (argc == 0) { return 1; } string line(""); int linesCount = 0; bool matched = false; while(!cin.eof() && (cin >> line)) { matched = false; linesCount++; for (int i = 0; i < argc; i++) { if (line.find(argv[i]) != string::npos) { if (!matched) { cout << linesCount << ": " << line << endl; } matched = true; } } } return 0; }