/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include <stdio.h>
int main()
{
int st, et, rt;
scanf("%d %d", &st, &et);
rt = et - st;
if (rt < 0)
{
rt = 24 + (et - st);
}
if (st == et)
{
printf("O JOGO DUROU 24 HORA(S)\n");
}
else printf("O JOGO DUROU %d HORA(S)\n", rt);
return 0;
}
//Happy_Coding
#include <stdio.h>
int main()
{
int st, et, rt;
scanf("%d %d", &st, &et);
rt = et - st;
if (rt < 0)
{
rt = 24 + (et - st);
}
if (st == et)
{
printf("O JOGO DUROU 24 HORA(S)\n");
}
else printf("O JOGO DUROU %d HORA(S)\n", rt);
return 0;
}
//Happy_Coding
No comments:
Post a Comment