xlang/test/sieve.x

16 lines
241 B
Plaintext
Raw Normal View History

2023-01-07 08:56:27 +00:00
main() : int {
print 2;
2023-01-07 16:10:03 +00:00
for i := 3; i < 100; i =+ 2 {
2023-01-07 08:56:27 +00:00
composite := false;
2023-01-07 16:10:03 +00:00
for j := 3; j < i; j =+ 2 {
2023-01-07 08:56:27 +00:00
if i % j == 0 {
composite = true;
break;
}
}
if not composite {
print i;
}
}
}