亲,哪有你这样比较的。首先是输入4个整数,您直接定义成float浮点型,这就不对。最好是把这些数装入一个数组内,再排序。
int main()
{
int a[4];
int tmp,count,i_count;
scanf("%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3]);
for(count = 0, count < 3, count++)
{
for(i_count = 0;i_count < 3-count; i_count++)
{
if(a[i_count]>a[i_count+1])
{
tmp = a[i_count];
a[i_count] = a[i_count+1];
a[i_count+1] = tmp;
}
}
for(count = 0; count < 4; count++)
{
printf("%d\n",a[count]);
}
return;
}