Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WINDOWS:
- #include <iostream>
- bool isPrime;
- unsigned long unsigned long a, b;
- int main()
- {
- for (a = 3; a < ULLONG_MAX; a += 2)
- {
- for (b = 3; b < a; b += 2)
- {
- if (a % b == 0)
- {
- isPrime = false;
- break;
- }
- isPrime = true;
- }
- if (isPrime)
- printf("%d,", a);
- }
- }
- TEMPLEOS:
- Bool isPrime;
- U64 i;
- U64 j;
- U0 main()
- {
- for (i = 3; i < U64_MAX; i += 2)
- {
- for (j = 3; j < i; j += 2)
- {
- if (i % j == 0)
- {
- isPrime = 0;
- break;
- }
- isPrime = 1;
- }
- if (isPrime == 1)
- {
- "%d\n",i;
- }
- }
- }
- main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement