ricop522

[COD] Números primos

Aug 6th, 2011
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. stock numeroPrimo(n)
  2. {
  3.     if (n < 2) return false;
  4.     for (new i = 2; i <= (n / 2); ++i)
  5.     {
  6.        if (n % i == 0) return false;
  7.     }
  8.     return true;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment