函数定义和函数调用参数问题
#include<stdio.h>int fun()
{
const float PK=3.1415;
float s;
float r;
printf("半径:\n");
scanf("%f",&r);
s=PK*r*r;
printf("面积%.2f\n",s);
return 0;
}
int main()
{
float a;
fun(a);
return 0;
}
为什么提示fun()参数太多
2020-06-10 10:24
2020-06-10 10:37
2020-06-10 10:52
程序代码:#include<stdio.h>
int fun()
{
const float PK=3.1415;
float s;
float r;
printf("半径:\n");
scanf("%f",&r);
s=PK*r*r;
printf("面积%.2f\n",s);
return 0;
}
int main()
{
fun();
return 0;
}

2020-06-10 10:54
2020-06-10 21:45