做法不唯一 仅供参考
double[] aar = new double[10]; int i = 0, j = 0; double t=0;
while (i < 10)
{ aar[i] = double.Parse(Console.ReadLine()); i++; }
while (j<9)
{
i = j + 1;
while (i < 10)
{
if (aar[j] < aar[i])
{ t = aar[j]; aar[j] = aar[i]; aar[i] = t; }
i++; }
j++;
}
Console.WriteLine("这十个数中的最大值与次大值为:");
Console.WriteLine("{0} {1}", aar[0],aar[1]);