Language/C++

[C++ / 백준 10872] 팩토리얼

ej503 2021. 8. 5. 16:30

#include <iostream>
using namespace std;



int facto(int n) {
if (n <= 1)
return 1;
else
return n * facto(n - 1);
}

int main() {
int n;
cin >> n;
cout << facto(n) << '\n';
}