// Adds all values given in the command line.
#include <iostream>
#include <cstdlib>

int main(int argc, char *argv[])
{
  using namespace std;

  if(argc==1 ) {
     cout << "Usage: addall <number1> <number2> ..." << endl;
     return 0;
  }

  double sum = 0.0;

  // get the parameters and convert them into real
  for(int p=0; p < argc; p++)
    sum += atof(argv[p]);

  cout << "The sum is " << sum << endl;

  return 0;
}
