fork download
  1. using System.Linq;
  2. using System.Threading.Tasks;
  3.  
  4. public class Program
  5. {
  6. public static void Main(string[] args)
  7. {
  8. for (int i=0; i<20; i++)
  9. System.Console.WriteLine(fibonacci(i));
  10. }
  11.  
  12. private static ulong fibonacci(int n)
  13. {
  14. ulong u = 0;
  15. ulong v = 1;
  16. ulong t;
  17. #if true
  18. Parallel.For(2, n + 1, i =>
  19. #else
  20. Enumerable.Range(2, n+1).ToList().ForEach(i =>
  21. #endif
  22. {
  23. t = u + v;
  24. u = v;
  25. v = t;
  26. });
  27. return v;
  28. }
  29. }
  30.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,24): error CS0234: The type or namespace name `Tasks' does not exist in the namespace `System.Threading'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty