Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- int H1, M1, H2, M2;
- std::cin >> H1 >> M1 >> H2 >> M2;
- int hoursDiff = 0;
- while (H1 % 24 != H2) {
- hoursDiff++;
- H1++;
- }
- int minutesDiff = 0;
- while (M1 % 60 != M2) {
- minutesDiff++;
- M1++;
- }
- std::cout << (hoursDiff - (1 * M1 > M2) + 24) % 24 << " " << minutesDiff;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement