Skip to content

Commit

Permalink
Solve LED in c
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Jul 24, 2024
1 parent 2db7495 commit a129a31
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions solutions/beecrowd/1168/1168.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <stdint.h>
#include <stdio.h>

int main() {
int32_t n, s, l[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

char d;

scanf("%d", &n);
getchar();

while (n--) {
s = 0;

while ((d = getchar()) != '\n') {
s += l[d - '0'];
}

printf("%d leds\n", s);
}

return 0;
}

0 comments on commit a129a31

Please sign in to comment.