fork download
  1. #include<bits/stdc++.h>
  2. #include <boost/multiprecision/cpp_int.hpp>
  3. namespace mp = boost::multiprecision;
  4. using namespace std;
  5. int main()
  6. {
  7. {
  8. int t;
  9. cin>>t;
  10. while(t--)
  11. {
  12. mp::cpp_int f=1,n;
  13. cin>>n;
  14. for(int i=1;i<=n;i++)
  15. f=f*i;
  16. cout<<f<<endl;
  17. }
  18. }
  19. }
  20.  
Success #stdin #stdout 0s 16128KB
stdin
5
1
10
20
66
5
stdout
1
3628800
2432902008176640000
544344939077443064003729240247842752644293064388798874532860126869671081148416000000000000000
120