04: Solve in C
This commit is contained in:
parent
83fa5d8bea
commit
4db64c45ca
|
@ -0,0 +1,12 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int a, b, c, d, S = 0, G = 0;
|
||||||
|
|
||||||
|
while (scanf("%d-%d,%d-%d", &a, &b, &c, &d) == 4) {
|
||||||
|
S += (a >= c && b <= d) || (c >= a && d <= b);
|
||||||
|
G += (a <= c && b >= c) || (c <= a && d >= a);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Silver: %d\nGold: %d\n", S, G);
|
||||||
|
}
|
Loading…
Reference in New Issue