朴素的模拟,细节有点多,需要特判。
请忽略奇怪的码风,saber代码。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d;
cin >>a >> b>>c>>d;
if (a == c && b == d) a=0,b=0,c=24,d=0;
if (a == c && b > d) c += 24;
if (a > c)
c += 24;
if (b > d)
d += 60, c -- ;
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)", c-a, d-b);
}