fork download
  1. #include <iostream>
  2. using namespace std ;
  3. int main(){
  4. int t,n;
  5. cin>>t;
  6. long long count1 =1 ;
  7. if (t<=15)
  8. for(int i =1 ; i<=t; i++)
  9. {
  10. cin>>n;
  11. if (n==0){
  12. cout << 1 <<endl;
  13. continue;
  14. }
  15. else if(n<=20){
  16. for(int x=1;x<=n;x++){
  17. count1=count1*x;
  18. }
  19.  
  20. cout<<count1<<endl;
  21. count1=1;
  22. }
  23.  
  24. }
  25. }
  26.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty