fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int divisors(unsigned long long int n){
  5. unsigned long long int l = (unsigned long long int)sqrt(n);
  6. int c=0;
  7. for(unsigned long long int i=1;i<=l;i++){
  8. if((n%i)==0) {
  9. c++;
  10. if(i!=(n/i))
  11. c++;
  12. }
  13.  
  14. }
  15. return c;
  16. }
  17.  
  18. int main(void) {
  19. unsigned long long int n = 1;
  20. unsigned long long int d = 1;
  21. printf("%d\n",divisors(5));
  22. while (divisors(d) <= 500) {
  23. n++;
  24. d+= n;
  25. }
  26. printf("%llu\n",d);
  27. }
  28.  
Success #stdin #stdout 0.41s 4392KB
stdin
Standard input is empty
stdout
2
76576500