#include <stdio.h>
#include <time.h>
#include <math.h>
int main(void) {
int count;
int i;
int j;
int c;
int prime;
clock_t start;
clock_t end;
double elapsed;
int primes[100];
/* init primes */
primes[0] = 2;
c = 1;
/* input */
/* measure time */
for (i = 3; c < count; i += 2) {
/* isPrime */
prime = 1;
for (j = 3; j < i; j += 2) {
if (i % j == 0) {
prime = 0;
break;
}
}
if (prime) {
primes[c] = i;
c = c + 1;
}
}
elapsed = end - start;
/* output */
for (i = 0; i < count; i++) {
}
printf("elapsed time:%f\n", elapsed
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDx0aW1lLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgY291bnQ7CglpbnQgaTsKCWludCBqOwoJaW50IGM7CglpbnQgcHJpbWU7CgljbG9ja190IHN0YXJ0OwoJY2xvY2tfdCBlbmQ7Cglkb3VibGUgZWxhcHNlZDsKCWludCBwcmltZXNbMTAwXTsKCQoJLyogaW5pdCBwcmltZXMgKi8KCXByaW1lc1swXSA9IDI7CgljID0gMTsKCQoJLyogaW5wdXQgKi8KCXNjYW5mKCIlZCIsICZjb3VudCk7CgkKCS8qIG1lYXN1cmUgdGltZSAqLwoJc3RhcnQgPSBjbG9jaygpOwoJZm9yIChpID0gMzsgYyA8IGNvdW50OyBpICs9IDIpIHsKCQkvKiBpc1ByaW1lICovCgkJcHJpbWUgPSAxOwoJCWZvciAoaiA9IDM7IGogPCBpOyBqICs9IDIpIHsKCQkJaWYgKGkgJSBqID09IDApIHsKCQkJCXByaW1lID0gMDsKCQkJCWJyZWFrOwoJCQl9CgkJfQoJCWlmIChwcmltZSkgewoJCQlwcmltZXNbY10gPSBpOwoJCQljID0gYyArIDE7CgkJfQoJfQoJZW5kID0gY2xvY2soKTsKCWVsYXBzZWQgPSBlbmQgLSBzdGFydDsKCQoJLyogb3V0cHV0ICovCglmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewoJCXByaW50ZigiJWQgIiwgcHJpbWVzW2ldKTsKCX0KCXByaW50ZigiXG4iKTsKCXByaW50ZigiZWxhcHNlZCB0aW1lOiVmXG4iLCBlbGFwc2VkKTsgCgkKCXJldHVybiAwOwp9