SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _08FactorialDivision
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             decimal firstNumber = decimal.Parse(Console.ReadLine());
  10.             decimal secondNumber = decimal.Parse(Console.ReadLine());
  11.  
  12.             decimal division = FirstNumberFact(firstNumber) / SecondNumberFact(secondNumber);
  13.  
  14.             Console.WriteLine($"{division:F2}");
  15.         }
  16.  
  17.         static decimal FirstNumberFact(decimal firstNum)
  18.         {
  19.             if (firstNum == 1)
  20.             {
  21.                 return 1;
  22.             }
  23.             else
  24.             {
  25.                 return firstNum * FirstNumberFact(firstNum - 1);
  26.             }
  27.         }
  28.  
  29.         static decimal SecondNumberFact(decimal secondNum)
  30.         {
  31.             if (secondNum == 1)
  32.             {
  33.                 return 1;
  34.             }
  35.             else
  36.             {
  37.                 return secondNum * SecondNumberFact(secondNum - 1);
  38.             }
  39.         }
  40.     }
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top