fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;
  7. cin>>t;
  8. while(t--){
  9. int n;
  10. cin>>n;
  11. long long int ans;
  12. if(n==0 || n==1)
  13. cout<<"1"<<"\n";
  14. else if(n<=15)
  15. {
  16. ans=1;
  17. for(int i=2;i<=n;i++)
  18. {
  19. ans*=i;
  20. }
  21. cout<<ans<<"\n";
  22. }
  23. else
  24. {
  25. cout<<" ";
  26.  
  27. }
  28. }
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 5500KB
stdin
1
15
stdout
1307674368000