Guest User

Untitled

a guest
Jan 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip>
  3. #include <stdint.h>
  4. #include <math.h>
  5. using namespace std;
  6.  
  7.  
  8.  
  9. int main() {
  10. long double Num = 0.0L;
  11. bool prim = true;
  12. for(long double i=5.0L; i<(600851475143L)/2; i+=2)
  13. {
  14. prim = true;
  15. for(long double z=3.0L; z<sqrt(i); z+=2)
  16. {
  17. if(fmod(i, z) == 0)
  18. {
  19. prim = false;
  20. break;
  21. }
  22. }
  23. if(prim)
  24. if(fmod(600851475143L, i)==0)
  25. Num = i;
  26. }
  27. cout << Num << "\n";
  28. system("Pause");
  29. return 0;
  30. }
Add Comment
Please, Sign In to add comment