Citation de code source en C++n° 275
10 June 2016 à 01:30
static const int Num = 5;
class Recursive
{
public:
long long result;
Recursive(int WhatIveGot, int Count)
{
if ( !Count ) result = 1;
if ( 0 >= WhatIveGot ) return;
result *= WhatIveGot;
new (this)Recursive(WhatIveGot-1, Count+1);
}
} a(Num, 0);
std::wcout << L"Factorial(" << Num << L"): " << a.result << std::endl;