1 static double TakeSquareRoot(int x)
2 {
3 //return Math.Sqrt(x);
4 return x + 1;
5 }
6
7 static void Main(string[] args)
8 {
9 List<int> integers = new List<int>();
10 integers.Add(1);
11 integers.Add(2);
12 integers.Add(3);
13 integers.Add(4);
14
15 //Converter<int, double> converter = TakeSquareRoot;
16 //List<double> doubles;
17 var doubles = integers.ConvertAll<double>(TakeSquareRoot);
18 foreach (double d in doubles)
19 {
20 Console.WriteLine(d);
21 }
22
23 Console.WriteLine("OK");
24
25 Console.ReadKey();
26 }