-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathP1_2017_Q4.c
More file actions
53 lines (50 loc) · 892 Bytes
/
Copy pathP1_2017_Q4.c
File metadata and controls
53 lines (50 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <stdio.h>
void verificarSoma(int soma){
if (soma > 100){
soma %= 100;
soma /= 10;
printf("RESP:%d", soma);
}
else if (soma < 10){
printf("RESP:0");
}
else{
soma /= 10;
printf("RESP:%d", soma);
}
}
int main(void) {
int h1, h2, m1, m2, s1, s2, soma;
scanf("%d %d %d %d %d %d", &h1, &m1, &s1, &h2, &m2, &s2);
if(h1 > h2){
soma = h1+m1+s1;
verificarSoma(soma);
}
else if(h2 > h1){
soma = h2+m2+s2;
verificarSoma(soma);
}
else{
if (m1 > m2){
soma = h1+m1+s1;
verificarSoma(soma);
}
else if(m2 > m1){
soma = h2+m2+s2;
verificarSoma(soma);
}
else{
if (s1 > s2){
soma = h1+m1+s1;
verificarSoma(soma);
}
else if (s2 > s1){
soma = h2+m2+s1;
verificarSoma(soma);
}
else{
printf("IGUAIS");
}
}
}
}