Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool czy_Pierwsza(int liczba)
- {
- if (liczba == 1)
- {
- return false;
- }
- if (liczba == 2)
- {
- return true;
- }
- if (liczba % 2 == 1)
- {
- for (int i = 3; i < liczba ; i++)
- {
- if (liczba % i == 0)
- {
- return false;
- }
- return true;
- }
- }
- else
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement