Skip to content

Commit

Permalink
Add kattis problem modulo in C
Browse files Browse the repository at this point in the history
  • Loading branch information
iandioch committed Dec 4, 2016
1 parent 8fa92d2 commit 49b1b03
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kattis/modulo/solution.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>
#include <string.h>

int main () {
int found [1000];
memset(found, 0, sizeof(found));
int i;
for (i = 0; i < 10; ++i) {
int n;
scanf("%d", &n);
found[n%42] = 1;
}
int tot = 0;
for (i = 0; i < 1000; ++i) {
if (found[i] > 0) ++tot;
}
printf("%d\n", tot);
return 0;
}

0 comments on commit 49b1b03

Please sign in to comment.