Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <time.h>
- int main(int argc, char **argv)
- {
- int q = 0;
- clock_t start, end;
- start = clock();
- for(int i = 2; i < 100000; i++) {
- int ndelers = 2;
- for(int j = 2; j < i; j++) {
- ndelers += i % j == 0;
- if(ndelers > 4)
- break;
- }
- if(ndelers == 4) {
- q++;
- } else {
- q = 0;
- }
- if(q == 3) {
- printf("i is %3d, ndelers is %d\n", i-1, ndelers);
- }
- }
- end = clock();
- printf("time was %lu.%lu\n", (end - start) / CLOCKS_PER_SEC, (end - start) % CLOCKS_PER_SEC / 10000);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement