Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $num1 = intval(readline());
- $num2 = intval(readline());
- $factorial1 = printFactorial($num1);
- $factorial2 = printFactorial($num2);
- printf("%.2f", ($factorial1/$factorial2));
- function printFactorial(int $n): float{
- $result = 1;
- for ($i = 1; $i <= $n; $i++){
- $result *= $i;
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement