ArmStrong Number

3

2 votes
Problem

GK given you a number n.Your task is to find whether the number is Armstrong or not.

INPUT:

The input consists of only single line containing number n.

OUTPUT:

Print 1 if the number is Armstrong .Otherwise print 0.

CONSTRAINT:

1<n<105

 

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

EXPLANATION:

1+53+33=1+125+27=153

Therefore 153 is an Armstrong number.

 

Editor Image

?