Untitled
unknown
plain_text
a month ago
297 B
9
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