fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. //using System.Threading.Tasks; this is not required it seems...i dont know C# just giving it a shot...but the compiler was showing that the error existed here!!!!
  6.  
  7. namespace experiment
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. long t = long.Parse(Console.ReadLine());
  14. List<long> lines = new List<long>();
  15. for (int i = 0; i <t; i++)
  16. {
  17. lines.Add(long.Parse(Console.ReadLine()));
  18. }
  19. foreach (long x in lines)
  20. {
  21. long result=1;
  22. for (long i = x; i>=1; i--)
  23. {
  24. result = result * i;
  25. }
  26. Console.WriteLine(result);
  27. }
  28. Console.ReadLine();
  29. }
  30. }
  31. }
Success #stdin #stdout 0.04s 33952KB
stdin
4
1
2
5
3
stdout
1
2
120
6