#include<stdio.h>
void main( )
{
float a, b , c ;
float temp;
printf("请随机输入三个数\n");
scanf_s("%f%f%f", &a, &b, &c);
if (a < b)
{
temp = a;
a = b;
b = temp;
}
if (a < c)
{
temp = a;
a = c;
c = temp;
}
if (b < c)
{
temp = b;
b = c;
c = temp;
}
printf("排序后三个数为%f\t%f\t%f\n", a, b, c);
system("pause");
return 0;
}
void main( )
{
float a, b , c ;
float temp;
printf("请随机输入三个数\n");
scanf_s("%f%f%f", &a, &b, &c);
if (a < b)
{
temp = a;
a = b;
b = temp;
}
if (a < c)
{
temp = a;
a = c;
c = temp;
}
if (b < c)
{
temp = b;
b = c;
c = temp;
}
printf("排序后三个数为%f\t%f\t%f\n", a, b, c);
system("pause");
return 0;
}