Learning Dart

This commit is contained in:
2023-04-06 11:35:43 -05:00
parent fab045379a
commit b16a5813cc
92 changed files with 6437 additions and 21 deletions

View File

@@ -0,0 +1,10 @@
import 'dart:math';
class ArmstrongNumbers {
bool isArmstrongNumber(String number) {
num total = 0;
number.runes.forEach((r) => total += pow(int.parse(String.fromCharCode(r)), number.length));
print("$number == $total");
return num.parse(number) == total;
}
}