Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double factorial(int n) {
- if (n == 0) {
- return 1;
- }
- else {
- return (n * factorial(n - 1));
- }
- }
- int main() {
- int n1, n2;
- cin >> n1 >> n2;
- printf("%.2f\n", factorial(n1) / factorial(n2));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement