回复 2楼 no1xijin
#include<stdio.h>
double imin(double,double);
int main(void)
{
double a,b,min;
printf("**********************************\n");
printf("this program is comparing two num.\n");
printf("**********************************\n");
printf("please enter first number(q to quit):");
while(scanf("%lf",&a)!=1)
{
printf("please enter a float number\n");
}
printf("please enter second number(q to quit):");
while(scanf("%lf",&b)!=1)
{
printf("please enter a float number\n");
}
printf("min number is %lf\n",imin(a,b));
printf("bye\n");
return 0;
}
double imin(double x,double y)
{
if(x<y)
return x;
else
return y;
}