using System;
using System.Threading;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
SaySomething(args[0]);
Console.WriteLine(result);
}
static async Task SaySomething(string key)
switch (key)
case "1":
await Task.Delay(5);
result = "1";
break;
case "2":
Thread.Sleep(5);
result = "2";
case "3":
await Task.FromResult(5);
result = "3";
case "4":
var thread = new Thread(() =>
result = "Nope";
});
thread.Start();
result = "4";
case "5":
var sum = 0;
Parallel.For(0, 3, i=>
Thread.Sleep(50);
sum += i;
result = sum.ToString();
private static string result;