#C8412. Armstrong Numbers Checker
Armstrong Numbers Checker
Armstrong Numbers Checker
Given a list of integers, determine for each integer whether it is an Armstrong number. An Armstrong number of n digits is an integer such that the sum of its digits each raised to the power n is equal to the integer itself. For example, 153 is an Armstrong number because 13 + 53 + 33 = 153.
Your task is to implement a program that reads an integer T
from standard input indicating the number of test cases, followed by T
integers. For each integer, print "Yes" if it is an Armstrong number, otherwise print "No".
Note: Ensure that your solution reads input from stdin
and writes output to stdout
.
inputFormat
The first line of input contains a single integer T, representing the number of test cases. This is followed by T lines, each containing a single integer N which is to be checked. The input is provided via standard input (stdin).
outputFormat
For each test case, output a single line containing "Yes" if the given integer is an Armstrong number, otherwise output "No". The output should be written to standard output (stdout).## sample
3
153
9474
123
Yes
Yes
No
</p>