Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. static bool IsPrime(BigInteger Num) // podstawowy
  2. {
  3. OpDivision = 0;
  4. {
  5. if (Num < 2) return false;
  6. else if (Num < 4) return true;
  7. else if (Num % 2 == 0)
  8. {
  9. OpDivision++;
  10. return false;
  11. }
  12. else for (BigInteger u = 3; u < Num / 2; u += 2)
  13. if (Num % u == 0)
  14. {
  15. OpDivision++;
  16. return false;
  17. }
  18. else return true;
  19. }
  20. Console.WriteLine(OpDivision);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement