fork download
  1. // Source: https://u...content-available-to-author-only...o.guide/general/io
  2.  
  3. #include <bits/stdc++.h>
  4. using namespace std;
  5.  
  6. const int N=1e5+10;
  7. int main() {
  8.  
  9. long long fact[N];
  10. fact[0]=fact[1]=1;
  11.  
  12. for(int i=2; i<=N;i++){
  13. fact[i]=fact[i-1]*i;
  14. }
  15.  
  16.  
  17. int t; cin>>t;
  18. while(t--){
  19. int n; cin>>n;
  20.  
  21. cout<<fact[n];
  22. }
  23. }
  24.  
Success #stdin #stdout 0.01s 5532KB
stdin
Standard input is empty
stdout
Standard output is empty