c语言求圆的面积和周长
来源:百度知道 编辑:UC知道 时间:2024/05/06 02:09:52
自己输入半径,求圆的面积和周长 我是这么做的
#include<stdio.h>
#define IP 3.1416
main()
{
float r,l,s;
printf("please enter a number");
scanf("%f",&r);
l=2*IP*r;
s=IP*r*r;
printf("l=%f\ns=%f\n");
}
我不知道哪里错了 请帮帮忙 谢谢
#include<stdio.h>
#define IP 3.1416
main()
{
float r,l,s;
printf("please enter a number");
scanf("%f",&r);
l=2*IP*r;
s=IP*r*r;
printf("l=%f\ns=%f\n");
}
我不知道哪里错了 请帮帮忙 谢谢
C#程序:
#define n 3.1415926#include<stdio.h>void main(){ double s,l,r; scanf("%lf",&r); s=n*r*r; l=2*n*r; printf("s=%lf\n l=%lf\n",s,l); //float 对应%f double对应 %lf}
拓展资料
求图像的周长
描述:
给一个用 .