Alarm Clock1

 avatar
user_3763047219
c_cpp
2 years ago
407 B
1
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<stdlib.h>

int main()
{
	int h1 = -1, m1 = -1, h2 = -1, m2 = -1;
	while (h1 + m1 + h2 + m2 != 0) {
		scanf("%d %d %d %d", &h1, &m1, &h2, &m2);
		if ((h2 * 60 + m2) > (h1 * 60 + m1)) {
			printf("%d\n", (h2 * 60 + m2) - (h1 * 60 + m1));
		}
		else {
			printf("%d\n", (h2 * 60 + m2) - (h1 * 60 + m1)+1440);
		}
		
	}
	return 0;
}