#include <iostream>
using namespace std;
unsigned difference_in_minutes(unsigned, unsigned);
int main()
{
unsigned start, end;
// cout << "Please input your start time in military time(example: 8:3=2030): ";
cin >> start;
// cout << "Please input your end time: ";
cin >> end;
cout << "Your elapsed time is " << difference_in_minutes(start, end) << " minutes.";
return 0;
}
unsigned minutes_since_midnight(unsigned military_time)
{
const unsigned hours = military_time / 100;
const unsigned minutes = military_time % 100;
return hours * 60 + minutes;
}
unsigned difference_in_minutes(unsigned begin_time, unsigned end_time)
{
const unsigned beg = minutes_since_midnight(begin_time);
const unsigned end = minutes_since_midnight(end_time);
return end - beg;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnVuc2lnbmVkIGRpZmZlcmVuY2VfaW5fbWludXRlcyh1bnNpZ25lZCwgdW5zaWduZWQpOwoKaW50IG1haW4oKQp7CiAgICB1bnNpZ25lZCBzdGFydCwgZW5kOwoKICAgIC8vIGNvdXQgPDwgIlBsZWFzZSBpbnB1dCB5b3VyIHN0YXJ0IHRpbWUgaW4gbWlsaXRhcnkgdGltZShleGFtcGxlOiA4OjM9MjAzMCk6ICI7CiAgICBjaW4gPj4gc3RhcnQ7CgogICAgLy8gY291dCA8PCAiUGxlYXNlIGlucHV0IHlvdXIgZW5kIHRpbWU6ICI7CiAgICBjaW4gPj4gZW5kOwoKICAgIGNvdXQgPDwgIllvdXIgZWxhcHNlZCB0aW1lIGlzICIgPDwgZGlmZmVyZW5jZV9pbl9taW51dGVzKHN0YXJ0LCBlbmQpIDw8ICIgbWludXRlcy4iOwoKICAgIHJldHVybiAwOwp9Cgp1bnNpZ25lZCBtaW51dGVzX3NpbmNlX21pZG5pZ2h0KHVuc2lnbmVkIG1pbGl0YXJ5X3RpbWUpCnsKICAgIGNvbnN0IHVuc2lnbmVkIGhvdXJzID0gbWlsaXRhcnlfdGltZSAvIDEwMDsKICAgIGNvbnN0IHVuc2lnbmVkIG1pbnV0ZXMgPSBtaWxpdGFy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