コード例 #1
0
        private void Main06()
        {
            DelMax dMx = new DelMax(MyUtility.MaxInt);
            DelMin dMn = new DelMin(MyUtility.MinInt);
            int    x   = MyUtility.ReadInt();
            int    y   = MyUtility.ReadInt("y ?= ");

            Console.WriteLine("Max({0}, {1}) = {2}", x, y, dMx(x, y));
            Console.WriteLine("Min({0}, {1}) = {2}", x, y, dMn(x, y));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: llxq/.net
        static object GetMax(object[] names, DelMax de)
        {
            object max = names[0];

            for (int i = 0; i < names.Length; i++)
            {
                if (de(names[i], max) > 0)
                {
                    max = names[i];
                }
            }
            return(max);
        }