public static void Main()
double s0 = 0, s1 = 1, s2 = 2, s3 = 3, s4 = 4, s5 = 5, s6 = 6, s7 = 7, s8 = 10, s9 = 10;
var arr = new double[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int first = 0, second=0, third=0;
first = FindMax(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, -1, -1);
second = FindMax(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, first, -1);
third = FindMax(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, first, second);
Console.WriteLine(arr[first]);
Console.WriteLine(arr[second]);
Console.WriteLine(arr[third]);
private static int FindMax(
if(Math.Max(max, s0) > max && indexOneToIgnore != 0 && indexTwoToIgnore != 0)
if(Math.Max(max, s1) > max && indexOneToIgnore != 1 && indexTwoToIgnore != 1)
if(Math.Max(max, s2) > max && indexOneToIgnore != 2 && indexTwoToIgnore != 2)
if(Math.Max(max, s3) > max && indexOneToIgnore != 3 && indexTwoToIgnore != 3)
if(Math.Max(max, s4) > max && indexOneToIgnore != 4 && indexTwoToIgnore != 4)
if(Math.Max(max, s5) > max && indexOneToIgnore != 5 && indexTwoToIgnore != 5)
if(Math.Max(max, s6) > max && indexOneToIgnore != 6 && indexTwoToIgnore != 6)
if(Math.Max(max, s7) > max && indexOneToIgnore != 7 && indexTwoToIgnore != 7)
if(Math.Max(max, s8) > max && indexOneToIgnore != 8 && indexTwoToIgnore != 8)
if(Math.Max(max, s9) > max && indexOneToIgnore != 9 && indexTwoToIgnore != 9)