fork download
  1. #include<bits/stdc++.h> // includes every standard library file
  2. #include<boost/multiprecision/cpp_int.hpp>
  3. namespace mp = boost::multiprecision;
  4. using namespace std;
  5. #define ll long long
  6. #include <string>
  7.  
  8. int main()
  9. { int t;
  10. cin>>t;
  11. while(t--)
  12. {
  13. mp::cpp_int n,f=1,i;
  14. cin>>n;
  15. for(i=1;i<=n;i++)
  16. f=f*i;
  17. cout << f<<endl;
  18. }
  19. }
Success #stdin #stdout 0s 15312KB
stdin
5
1
2
3
4
5
stdout
1
2
6
24
120