All pastes #884534 Raw Edit

Miscellany

public cpp v1 · immutable
#884534 ·published 2008-01-30 12:48 UTC
rendered paste body
#include <iostream>#include <string>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;}