冒泡排序法还需进一步理解,暂且照猫画虎尝试理解。
int a = Convert.ToInt32(Console.ReadLine()), b = Convert.ToInt32(Console.ReadLine()), c = Convert.ToInt32(Console.ReadLine());
if (a > b) //假设abc分别等于20,5,15
{
int temp = a;//temp=20
a = b;//a=5
b = temp;//b=20
}
if (b > c)
{
int temp = b;//b=20
b = c;//b=15
c = temp;//c=20
//跳过
}
if (a > b)
{
int temp = a;
a = b;
b = temp;
}
Console.WriteLine(a + " " + b + " "+c);