很简单的一个求绝对值的程序,有点错,高手HELPME
double abstr (double x){
if(x<0.0)
x=-x;
else
x=x;
return (x);
}
#include <stdio.h>
int main(void)
{
double a,abstr(double a);
printf("enter areal number please:");
scanf("%1f",&a);
printf("abstr(%1f)=%1f\n",a,abstr(a));
return 0;
}