Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
function isPrime ($n) {
|
||||
if ($n -eq 1) {$false}
|
||||
elseif ($n -eq 2) {$true}
|
||||
elseif ($n -eq 3) {$true}
|
||||
else{
|
||||
$m = [Math]::Floor([Math]::Sqrt($n))
|
||||
(@(2..$m | where {($_ -lt $n) -and ($n % $_ -eq 0) }).Count -eq 0)
|
||||
}
|
||||
}
|
||||
1..15 | foreach{"isPrime $_ : $(isPrime $_)"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue