
// Barlow and Barnett, Computing for Scientists 1998
// page 16                  C++ and Fortran 90

//      The C++ version

// Altered by Jim Crumley 1/12/2007 to fix g++ incompatibilities

#include <iostream>

main()
{
  // Convert a number of seconds to the
  // "hours, minutes, seconds" notation
  
  using namespace std;

  int total;
  cout << " Time in seconds? \n";
  cin  >> total;                      // read in time
  int hour = total/3600;              // integer divide
  int minute = (total - 3600*hour) / 60; 
  int second =
    total - 3600*hour - 60*minute;
  cout << " A time of " << total << " seconds \n";
  cout << " corresponds to \n";
  cout << hour << "  hours \n";
  cout << minute << "  minutes and\n";
  cout << second << "  seconds\n"; 
  return 0;
}

