└── Armstrong number /Armstrong number: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class Main 3 | { 4 | public static void main(String[] args) 5 | { 6 | Scanner Sc = new Scanner(System.in); 7 | int a=Sc.nextInt(); 8 | int b,c=0,d=a; 9 | while(a>0) 10 | { 11 | b=a%10; 12 | c=c+b*b*b; 13 | a=a/10; 14 | } 15 | if(d==c) 16 | { 17 | System.out.println("Armstrong num"); 18 | } 19 | else{ 20 | System.out.println("Not a Armstrong num"); 21 | } 22 | 23 | } 24 | } 25 | --------------------------------------------------------------------------------