// repeatGreet.cc  A quick demo of int main(int argc, char *argv[])
// P. Conrad, for CISC181 E02 review, Spring 2006


#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{

  // we expect exactly three things on the command line.
  // If we don't get that, print an error message and stop.
  // argv[0] echoes whatever command the user typed to run the program.

  if (argc != 3)
    {
      cerr << "Usage: " << argv[0] << " numTimes greeting" << endl;
      exit(1);
    }

  int numTimes = atoi(argv[1]);

  char *greeting = argv[2];

  for (int i=0; i< numTimes; i++)
    cout << greeting << endl;

  return 0;
}

