用指针返回两个数中较小的一个

#include<stdio.h>
int* small(int* a,int* b);
int main(void)
{
int a,b;
printf("请输入两个数字: ");
scanf("%d%d",&a,&b);
int *s;
s=small(&a,&b);
printf("%d ",*s);
return 0;
}
int* small(int* a ,int* b)
{
return *a>*b?b:a;
}
原文地址:https://www.cnblogs.com/wsq724439564/p/3258162.html