Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
14
Task/Perfect-numbers/PowerShell/perfect-numbers.ps1
Normal file
14
Task/Perfect-numbers/PowerShell/perfect-numbers.ps1
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Function IsPerfect($n)
|
||||
{
|
||||
$sum=0
|
||||
for($i=1;$i-lt$n;$i++)
|
||||
{
|
||||
if($n%$i -eq 0)
|
||||
{
|
||||
$sum += $i
|
||||
}
|
||||
}
|
||||
return $sum -eq $n
|
||||
}
|
||||
|
||||
Returns "True" if the given number is perfect and "False" if it's not.
|
||||
Loading…
Add table
Add a link
Reference in a new issue