该程序是运用VS2019来实现计算圆的面积
# include <stdio.h>
#define PI 3.14
float S(float r)
{
float a;
a = PI * r * r;
return a;
}
int main(void)
{
float x, y;
printf("请输入圆的半径r=");
scanf_s("%f", &x);
y = S(x);
printf("圆的面积为:%f", y);
return 0;
}
该程序是运用VS2019来实现计算圆的面积
# include <stdio.h>
#define PI 3.14
float S(float r)
{
float a;
a = PI * r * r;
return a;
}
int main(void)
{
float x, y;
printf("请输入圆的半径r=");
scanf_s("%f", &x);
y = S(x);
printf("圆的面积为:%f", y);
return 0;
}