//program for checking Armstrong Number
//An Armstromg number is one which is equal to the sum of the cubes of its digits
//Eg. 153=1³+5³+3³=1+125+27=153...
import java.io.*;
class armstrong
{
public static void main(String aa[]) throws IOException
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
int a, b=0, c, d;
System.out.println("Enter a number to check for Armstong");
String S=br.readLine();
a=Integer.parseInt(S);
c=a;
while(c!=0)
{
d=c%10;
c=c/10;
b+=d*d*d;
}
if(a==b)
System.out.println(a+" is an Armstrong no.");
else
System.out.println(a+" is NOT an Armstrong no.");
}
}
//An Armstromg number is one which is equal to the sum of the cubes of its digits
//Eg. 153=1³+5³+3³=1+125+27=153...
import java.io.*;
class armstrong
{
public static void main(String aa[]) throws IOException
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
int a, b=0, c, d;
System.out.println("Enter a number to check for Armstong");
String S=br.readLine();
a=Integer.parseInt(S);
c=a;
while(c!=0)
{
d=c%10;
c=c/10;
b+=d*d*d;
}
if(a==b)
System.out.println(a+" is an Armstrong no.");
else
System.out.println(a+" is NOT an Armstrong no.");
}
}