#include
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
if(argc!=3) {
cout << "Usage: SEARCH \n";
return 1;
}
ifstream in(argv[1]);
if(!in) {
cout << "Cannot open input file.\n";
return 1;
}
char str[255];
int count=0;
while(!in.eof()) {
in >> str;
if(!strcmp(str, argv[2])) count++;
}
cout << argv[2] << " found " << count;
cout << " number of times.\n";
in.close();
return 0;
}