Вычислить значение n! 1 ≤ n ≤ 12 Важно: n! = 1 × 2 × … × n Пример: 3! = 1 × 2 × 3 = 6
#include
using namespace std;
int fact(int n){
if(n == 0 || n == 1) return 1;
return n * fact(n-1);
}
signed main() {
int n;
cin >> n;
cout << fact(n);</p>