Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 12 / fact.cpp
blob: bd97a5e3ef5b0069a4d17908235b3f89163621f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>



unsigned factRec(unsigned n)  // О(n)
{
	if (n == 0)
		return 1;
	return n * factRec(n - 1);
}

int main()
{
 std::cout << factRec(5); 
  
}