/***************************************************
Converting time from hh:mm:ss to seconds.
Write a program that reads in a value for ellapsed
time in the format hh:mm:ss and prints out the
ellapsed time in seconds. So, if the user enters:
02:33:01
your program should print out
9181
***************************************************/
#include <iostream>
using namespace std;
int main()
{
// Read time
cout << "Enter ellapsed time in hh:mm:ss format: ";
int h, m, s;
char t;
cin >> h >> t >> m >> t >> s;
// Convert to seconds
int totals;
totals = h*60*60 + m*60 + s;
// Print result
cout << "Ellapsed time is " << totals
<< " seconds" << endl;
return 0;
}