blob: f3e38f63b13bf904dfb7ec3991a16a0b3d19d550 (
plain) (
tree)
|
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
size_t veriga (size_t n, size_t s) {
for (size_t i = 2; i <= n; i++) {
if (n % i != 0)
return veriga(i, s+1);
}
return s;
}
int main (int argc, char ** argv) {
size_t i;
char in[128];
fgets(in, 127, stdin);
char * p;
size_t a = strtoll(in, &p, 10);
size_t b = strtoll(p, NULL, 10);
size_t sum = 0;
/* fprintf(stderr, "%lu, %lu\n", a, b); */
for (size_t x = a; x <= b; x++) {
sum += veriga(x, 1);
}
fprintf(stdout, "%lu\n", sum);
return 0;
}
|