Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- string time1, time2;
- cin >> time1 >> time2;
- double x_hours = stoi(time1.substr(0, 2));
- double x_mins = stoi(time1.substr(3, 2));
- double y_hours = stoi(time2.substr(0, 2));
- double y_mins = stoi(time2.substr(3, 2));
- double minutes_between = (60 - y_mins) + (60 * (x_hours - (y_hours + 1))) + x_mins;
- cout << minutes_between << " minutes" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement