这个程序有问题啊
#include <stdio.h>double min(double a, double b);
int main(void)
{
double x, y;
printf ("Enter two numbers (q to quit): ");
while (scanf("%lf %lf", &x, &y) == 2)
{
printf("The smaller number is %lf.\n", min(x, y));
printf("Next two values (q to quit): ");
}
printf ("Bye!\n");
return 0;
}
double min(double a, double b)
{
if (a < b)
return a;
else
return b;
}
没问题啊,你输入2个数中间要带空格 ,另外你printf("The smaller number is %lf.\n", min(x, y));
把lf后面的.去掉就更好了
页:
[1]