MeehoweCK

Untitled

Jun 5th, 2024
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. bool primal(int liczba) {
  2.     if (liczba < 2) {
  3.         return false;
  4.     }
  5.     for (auto i{ 2 }; i * i <= liczba; ++i) {
  6.         if (liczba % i == 0) {
  7.             return false;
  8.         }
  9.     }
  10.     return true;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment