请问这是什么意思啊?该怎么解呢?

编写函数 function1,用于将三个整数按从小到大排序。要求,该函数的输入参数为:int, int,int*,无返回值。在 main函数中调用时,如function1(&a,&b,&c),a、b 和 c 为三个整型变量,调用后,a 里存放最小的,b 里存放第二大的,c 里存放最大的。

#include <stdio.h>
void function1(int* a,int* b,int* c);
int main()
{
int a = 3,b = 11,c = 2;
function1(&a,&b,&c);
printf("a = %d, b = %d, c = %d\n",a,b,c);
return 0;
}

void function1(int* a,int* b,int* c)
{
int temp1,temp2,temp3;
if(*a < *b)
{
temp2 = *a;
if(temp2 > *c)
{
temp1 = *c;
*a = temp1;
temp3 = *b;
*c = temp3;
*b = temp2;
}else
{
if(*b < *c)
{
}else
{
temp3 = *b;
temp2 = *c;
*c = temp3;
*b = temp2;
}

    }
    
}else
{
    if(*a < *c)
    {
        temp1 = *b;
        temp2 = *a;
        *a = temp1;
        *b = temp2;
    }else
    {
        temp3 = *a;
        if(*b > *c)
        {
            temp1 = *c;
            *a = temp1;
            *c = temp3;
        }else
        {
            temp1 = *b;
            temp2 = *c;
            temp3 = *a;
            *c = temp3;
            *b = temp2;
            *a = temp1;
        }
    }
    
}

}

首先int表示值传递 int*表示地址传递因此这个函数只能返回最大值而不能按照你的要求返回三个值,要想返回三个值,传递三个参数的时候必须都采用地址传递这样在函数中实现三个变量及abc分别存储最小,中间,最大即可得到结果

供参考:

#include <stdio.h>
void function1(int*, int*, int*);
int main()
{
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    function1(&a, &b, &c);
    printf("a=%d,b=%d,c=%d", a, b, c);
    return 0;
}
void function1(int* a, int* b, int* c)
{
    int t;
    if (*a > *b)
        t = *a, * a = *b, * b = t;
    if (*a > *c)
        t = *a, * a = *c, * c = t;
    if (*b > *c)
        t = *b, * b = *c, * c = t;
}