Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(int argc, char** argv) {
  5.  
  6. int primeFactorCheck = 0;
  7.  
  8.  
  9. for (int factorCheck = 2; factorCheck < 600851475143; ++factorCheck)
  10. {
  11. //primeFactorCheck = factorCheck - 1;
  12.  
  13.  
  14. for (int primeFactorCheck = factorCheck - 1; factorCheck % primeFactorCheck != 0 and 600851475143 % factorCheck == 0 and primeFactorCheck > 1; --primeFactorCheck)
  15. {
  16.  
  17. if (primeFactorCheck == 2)
  18. {
  19. cout << factorCheck << " is a prime factor within 600851475143!" << endl;
  20. break;
  21. }
  22.  
  23.  
  24.  
  25. }
  26.  
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement