fork download
  1. #include <iostream>
  2.  
  3. template< int n > struct Factoriel {
  4. static const uint64_t value = n * Factoriel< n-1 >::value;
  5. };
  6.  
  7. template<> struct Factoriel< 1 > {
  8. static const uint64_t value = 1;
  9. };
  10.  
  11. using namespace std;
  12.  
  13. int main() {
  14.  
  15. cout << Factoriel<10>::value, cout << endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
3628800