SHARE
TWEET

10sept2019

a guest Sep 10th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <time.h>
  4.  
  5. int main(int argc, char **argv)
  6. {
  7.     int q = 0;
  8.     clock_t start, end;
  9.     start = clock();
  10.     for(int i = 2; i < 100000; i++) {
  11.        
  12.         int ndelers = 2;
  13.         for(int j = 2; j < i; j++) {
  14.             ndelers += i % j == 0;
  15.             if(ndelers > 4)
  16.                 break;
  17.         }
  18.         if(ndelers == 4) {
  19.             q++;
  20.         } else {
  21.             q = 0;
  22.         }
  23.         if(q == 3) {
  24.             printf("i is %3d, ndelers is %d\n", i-1, ndelers);
  25.         }
  26.     }
  27.     end = clock();
  28.     printf("time was %lu.%lu\n", (end - start) / CLOCKS_PER_SEC, (end - start) % CLOCKS_PER_SEC / 10000);
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top