用函数找大数
程序:
#include<stdio.h>
int max(int x,int y)
{
int z;
z = x > y ? x : y;
return z;
}
int main()
{
int a,b,c;
printf("please enter two integer numbers:");
scanf("%d,%d",&a,&b);
c = max(a,b);
printf("max is %d\n",c);
return 0;
}
结果:
lease enter two integer numbers:3,5
max is 5
请按任意键继续. . .