Well, we all know that if N is given it\'s easy to calculate N!. But what about the inverse?
N! is given and you are about to find N - Is that possible ? I\'m curio
C/C++ code for what the factorial (r is the resulting factorial):
what the factorial
r
int wtf(int r) { int f = 1; while (r > 1) r /= ++f; return f; }
Sample tests:
Call: wtf(1) Output: 1 Call: wtf(120) Output: 5 Call: wtf(3628800) Output: 10