Posts

URI Online Judge | 1047 Game Time with Minutes (Solution)

Image
Problem Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1047 URI Online Judge | 1047 Game Time with Minutes Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Read the start time and end time of a game, in hours and minutes (initial hour, initial minute, final hour, final minute). Then print the duration of the game, knowing that the game can begin in a day and finish in another day, Obs.:  With a maximum game time of 24 hours and the minimum game time of 1 minute. Input Four integer numbers representing the start and end time of the game. Output Print the duration of the game in hours and minutes, in this format: “O JOGO DUROU XXX HORA(S) E YYY MINUTO(S)” . Which means: the game lasted XXX hour(s) and YYY minutes. Sample Input Sample Output 7 8 9 10 O JOGO DUROU 2 HORA(S) E 2 MINUTO(S) 7 7 7 7 O JOGO DUROU 24 HORA(S) E 0 MINUTO(S) 7 10 8 9 O JOGO DUROU 0 HORA(S) E 59 MINUTO(S) Solution: 1 2 3 4 5 6 ...

URI Online Judge | 1046 Game Time (Solution)

Image
Problem Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1046 URI Online Judge | 1046 Game Time Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Read the start time and end time of a game, in hours. Then calculate the duration of the game, knowing that the game can begin in a day and finish in another day, with a maximum duration of 24 hours. The message must be printed in portuguese “O JOGO DUROU X HORA(S)” that means “THE GAME LASTED X HOUR(S)” Input Two integer numbers representing the start and end time of a game. Output Print the duration of the game as in the sample output. Sample Input Sample Output 16 2 O JOGO DUROU 10 HORA(S) 0 0 O JOGO DUROU 24 HORA(S) 2 16 O JOGO DUROU 14 HORA(S) Solution: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include <stdio.h> int main() {      int st, et, rt;      scanf ( "%d %d" , ...