blob: d24fb17b57cdb0d6f58a8aef29632e7b920bce86 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int game;
int sum = 0;
while (1 == scanf("Game %d: ", &game)) {
int n;
char c[6];
while (scanf("%d %5[a-z]%*c", &n, c) > 0) {
if (c[0] == 'r' && n > 12) game = 0;
if (c[0] == 'g' && n > 13) game = 0;
if (c[0] == 'b' && n > 14) game = 0;
}
sum += game;
}
printf("%d\n", sum);
}
|