Advertisement
Stan0033

Untitled

Jun 13th, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace strong_number
  5. {
  6. class Program
  7. {
  8. static void Main()
  9. {
  10.  
  11. int fact1 = GetInput_Int();
  12. int fact2 = GetInput_Int();
  13. BigInteger fact11 = Factorial(fact1);
  14. BigInteger fact22 = Factorial(fact2);
  15. Console.WriteLine((fact11 / fact22).ToString("F2"));
  16.  
  17. }
  18. static int GetInput_Int() { return int.Parse(Console.ReadLine()); }
  19. static double GetInput_Double() { return double.Parse(Console.ReadLine()); }
  20. static decimal GetInput_Decimal() { return decimal.Parse(Console.ReadLine()); }
  21. static float GetInput_Float() { return float.Parse(Console.ReadLine()); }
  22. static bool GetInput_Bool() { return bool.Parse(Console.ReadLine()); }
  23. static string GetInput() { return Console.ReadLine(); }
  24.  
  25.  
  26. static BigInteger Factorial(int number)
  27. {
  28. BigInteger fact = 1;
  29. for (int i = 1; i <= number; i++)
  30. {
  31. fact = fact * i;
  32. }
  33. return (fact);
  34. }
  35. }
  36. }
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement