parent
cbb0c57d81
commit
f94c3eb3cb
|
@ -1,9 +1,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
int a, b, c, d, S = 0, G = 0;
|
int a, b, c, d, S = 0, G = 0;
|
||||||
|
char l[64], *e;
|
||||||
|
|
||||||
while (scanf("%u-%u,%u-%u", &a, &b, &c, &d) == 4) {
|
while (fgets(l, 64, stdin)) {
|
||||||
|
a = b = c = d = 0;
|
||||||
|
e = l;
|
||||||
|
#define rdec(V) { while (isdigit(*e)) V = 10 * V + (*e++ - '0'); e++; }
|
||||||
|
rdec(a) rdec(b) rdec(c) rdec(d)
|
||||||
S += (a >= c && b <= d) || (c >= a && d <= b);
|
S += (a >= c && b <= d) || (c >= a && d <= b);
|
||||||
G += (a <= c && b >= c) || (c <= a && d >= a);
|
G += (a <= c && b >= c) || (c <= a && d >= a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue