Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace StrongNumber
- {
- class Program
- {
- static void Main(string[] args)
- {
- string strNum = Console.ReadLine();
- int number = int.Parse(strNum);
- int sum = 0;
- for (int i = 1; i <= strNum.Length; i++)
- {
- int factorial = 1;
- for (int j = 1; j <= number % 10; j++)
- {
- factorial *= j;
- }
- sum += factorial;
- number /= 10;
- }
- Console.WriteLine(int.Parse(strNum) == sum ? "yes" : "no");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement