static void Main(string[] args) { SuperList sl = new SuperList() { -34, 5, 23, -25, -1005, 2525 }; double min; double max; sl.GetMinMax(out min, out max); Console.WriteLine(min); Console.WriteLine(max); SuperList.MinMax valores; valores = sl.GetMinMax(); Console.WriteLine($"{valores.Min} e {valores.Max}"); Tuple <double, double> t; t = sl.GetMinMax2(); Console.WriteLine($"{t.Item1} & {t.Item2}"); }
static void Main(string[] args) { // Declare variables double min, max; SuperList.MinMax valores; Tuple <double, double> t; // Instanciar Superlist SuperList list = new SuperList() { -24, 3, 4.5, -2.3, -100.3, 23 }; // Get min and max list.GetMinMax(out min, out max); valores = list.GetMinMax(); t = list.GetMinMax2(); // Print out first result with first method overload Console.WriteLine($"{min} and {max}"); Console.WriteLine(); // Print out second result with second method overload Console.WriteLine($"{valores.Min} and {valores.Max}"); Console.WriteLine(); // Print out third result with third method overload with tuples Console.WriteLine($"{t.Item1} and {t.Item2}"); }
static void Main(string[] args) { double min, max; SuperList spList = new SuperList { 1.0, 3.5, 2.7, 60.4, 17.4, 0.8 }; spList.GetMinMax(out min, out max); Console.WriteLine($"min is {min}, max is {max}"); Console.ReadKey(); }