double zhouchang();
double mianji();
改为
double zhouchang(double r);
double mianji(double r);
n=zhouchang(double r);
s=mianji(double r);
改为
n=zhouchang(r);
s=mianji(r);
函数声明时要说明参数类型,调用时不用再写类型的。
#include
#include
#define PI 3.14
double zhouchang(double);
double mianji(double);
void main()
{
double r,n,s;
printf("请输入圆的半径:");
scanf("%lf",&r);
n=zhouchang(r);
s=mianji(r);
printf("周长为:%.2f,面积为:%.2f",n,s);
}
double zhouchang(double r)
{
double t;
t=2*PI*r;
return t;
}
double mianji(double r)
{
double m;
m=PI*pow(r,2);
return m;
}
把这一条‘double zhouchang(double r);’复盖‘double zhouchang(); ’
同样的‘double mianji(double r); ’复盖;‘double mianji(); ’
继续努力呀!