麻烦各位看看这个程序的错误 谢谢
#include <stdio.h>#include <math.h>
double magic1 (double num1,double num2)
{
double num3;
num3 = (sqrt ((num1 + num2)/2) + sqrt ((num1 - num2)/2))/2;
return num3;
}
double magic2 (double num1,double num2)
{
double num3;
num3 = (sqrt ((num1 + num2)/2) - sqrt ((num1 - num2)/2))/2;
return num3;
}
int main ()
{
double a,b;
scanf ("%d %d" ,a,b);
double x = magic1 (a,b);
double y = magic2 (a,b);
printf ("%lf %lf",x,y);
return 0;
}
[此贴子已经被作者于2018-2-20 12:12编辑过]