Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int h = cin.nextInt() - cin.nextInt();
if (h == 0)
h = 24;
else if (h < 0)
h = -h;
else
h = 24 - h;
System.out.println ("O JOGO DUROU " + h + " HORA(S)");
}
}