Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _6.Strong_Number
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- int Num = N;
- int Total = 0;
- while (Num > 0)
- {
- int Sum = 1;
- int Number = Num % 10;
- Num = Num / 10;
- for(int i=Number;i>0;i--)
- {
- Sum *= i;
- }
- Total += Sum;
- }
- if (N == Total)
- {
- Console.WriteLine("yes");
- }
- else
- {
- Console.WriteLine("no");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment