编程题:输入a、b两个数,输出其中最大值。
#include<stdio.h>
float max(float x,float y)
{ float z;
if(x>y) z=x;
else z=y;
return z;}
main()
{ float a,b,c;
scanf("%f,%f",&a,&b);
c=max(a,b);
printf("%f,%f,the max is %f\n",a,b,c);
}
输入:23,56
输出:23.000000,56.000000,max is 56.000000