这种算法的思路就是两两比较大小,从大到小就用小于号,从小到大就用大于号,比较三次,for 循环3次就ok
//将三个数按从大到小输出。
//int main()
//{
// int a = 10;
// int b = 5;
// int c = 20;
// int i = 0;
// for (i = 0; i < 3; i++)
// {
// if (a < b)
// {
// int temp1 = a;
// a = b;
// b = temp1;
// }
// if (a < c)
// {
// int temp1 = a;
// a = c;
// c = temp1;
// }
// if (b < c)
// {
// int temp1 = b;
// b = c;
// c = temp1;
// }
//
// }