Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int num = int.Parse(Console.ReadLine());
- int a = num;
- int b = num;
- int counter = 0;
- while (true)
- {
- a /= 10;
- counter++;
- if (a == 0)
- {
- break;
- }
- }
- int sum = 1;
- int counterA = 0;
- for (int i = 0; i < counter; i++)
- {
- int diget = num % 10;
- counterA++;
- for (int j = 1; j <= diget; j++)
- {
- sum *= j;
- }
- num /= 10;
- }
- if (sum == b)
- {
- Console.WriteLine("yes");
- }
- else
- {
- Console.WriteLine("no");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement