-
Notifications
You must be signed in to change notification settings - Fork 0
/
1168.c
63 lines (52 loc) · 1.33 KB
/
1168.c
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
54
55
56
57
58
59
60
61
62
63
#include <stdio.h>
int main()
{
int n; scanf("%d", &n); getchar();
while(n--)
{
char caractere;
int contador_leds = 0;
while(scanf("%c", &caractere) == 1)
{
if(caractere == '\n')
{
break;
}
switch(caractere)
{
case '0':
contador_leds += 6;
break;
case '1':
contador_leds += 2;
break;
case '2':
contador_leds += 5;
break;
case '3':
contador_leds += 5;
break;
case '4':
contador_leds += 4;
break;
case '5':
contador_leds += 5;
break;
case '6':
contador_leds += 6;
break;
case '7':
contador_leds += 3;
break;
case '8':
contador_leds += 7;
break;
case '9':
contador_leds += 6;
break;
}
}
printf("%d leds\n", contador_leds);
}
return 0;
}