fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. //printf("Hello World!\n");
  7. long long int t,i,n;
  8. long long int dp[100005];
  9. dp[0] = 1;
  10. dp[1] = 1;
  11. for(i=2;i<=100000;i++)
  12. {
  13. dp[i] = (i*dp[i-1]);
  14. dp[i] = dp[i]%(1000000007);
  15. }
  16. scanf("%lld",&t);
  17. while(t--)
  18. {
  19. scanf("%lld",&n);
  20. printf("%lld\n",dp[n]);
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 15880KB
stdin
Standard input is empty
stdout
Standard output is empty