Untitled
Anonymous
plain_text
01/08/2025 5:58 PM
396 B
24
Indexable
static bool SavršenBroj(int n)
{
var djelitelji = new List<int>() { 1 };
for (int i = 2; i < n/2; i++)
{
if (n % i == 0) djelitelji.Add(i);
}
var suma = 0;
foreach (int i in djelitelji) suma += i;
if (n == suma) return true;
else return false;
}Editor is loading...
Leave a Comment