这C题对你来说有难度哦
请编写函数,对传送过来的三个数选出最大数和最小数,并通过形参传回条用函数
#include <stdio.h>
void get_max_min(int a, int b, int c, int *max, int *min)
{
*max = a>b?a:b;
*max = *max>c?*max:c;
*min = a<b?a:b;
*min = *min<c?*min:c;
}
int main(void)
{
int a, b, c, max, min;
scanf("%d%d%d", &a, &b, &c);
get_max_min(a,b,c,&max,&min);
printf("max = %d, min = %d\n", max, min);
}