1 2 3 4 5 6 7 8 9 10
#include <iostream> int fact_rec(int n) { if (n <= 1) return 1; return n * fact_rec(n - 1); } int main() { std::cout << fact_rec(5) << "\n"; }