Last active
January 17, 2023 11:52
-
-
Save Titory0/cdd6319d89e3e7113970f99c1e970e17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ft_armstrong(int number) | |
{ | |
string nombre=number.ToString(); | |
double nombreL=nombre.Length; | |
double calcul=0; | |
foreach(char numbers in nombre) | |
{ | |
int bar = numbers - '0'; | |
calcul+= Math.Pow(bar,3); | |
} | |
if(calcul==number) | |
{ | |
return ("Armstrong"); | |
} | |
return ("Not Armstrong"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment