fork download
  1. #include <boost/multiprecision/cpp_int.hpp>
  2. #include <iostream>
  3. using namespace std; // consider removing this line in serious projects
  4.  
  5. boost::multiprecision::cpp_int fact(int n)
  6. {
  7. boost::multiprecision::cpp_int fact = 1;
  8. for(int i = n ; i > 0 ; --i)
  9. {
  10. fact = fact * i;
  11. }
  12. return fact;
  13. }
  14.  
  15. int main() {
  16. boost::multiprecision::cpp_int result;
  17. result = fact(45)/(fact(44));// * fact(25));
  18. cout << result << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 5308KB
stdin
1
2
10
42
11
stdout
45