Strong Number
Submissions: 2571   Accuracy:

59.08%

  Difficulty: Basic   Marks: 1

Write a program to check whether a number is strong or not. A number is called strong number if sum of the factorial of its digit is equal to number itself. For example: 145 as 1! + 4! + 5! = 1 + 24 + 120 = 145

Input:
First line contains number of test cases T. Then following T lines contains an integer N.


Output:
Output "Strong" if given number is strong else "Not Strong" .

Constraints:
1 <= T <= 50
0 <= N <= 1000

Example:
Input:
2
145
10

Output:
Strong
Not Strong

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Mudit Maheshwari
Author: dipjal1996


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.