C#中delegate施用

C#中delegate使用using Systemusing System.Collections.Genericusing System.Linqusing System.Textn

C#中delegate使用

using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Demo{    public delegate int Fun(int i);    class Program    {         static void Main(string[] args)        {            Fun f = sqrt;            Console.WriteLine(f(5));            f = cube;            Console.WriteLine(f(5));            Console.ReadKey();        }        static int sqrt(int x)        {            return x * x;        }        static int cube(int x)        {            return x * x * x;        }    }}
?