C语言啊啊啊6
答案:5 悬赏:20 手机版
解决时间 2021-05-11 04:16
- 提问者网友:捧腹剧
- 2021-05-10 23:16
•已知圆的三个边长,求圆的面积,用函数来实现。(在main函数中输入三条边长,子函数中求面积,并返回结果)
最佳答案
- 五星知识达人网友:行雁书
- 2021-05-11 00:11
#include<stdio.h>
#include<math.h>
int main()
{
void Area(float a,float b,float c,float p);
float a,b,c;
float p;//p为半周长
printf("Input a,b c\n");
scanf("%f%f%f",&a,&b,&c);
if((a+b)>c&&(a+c)>b&&(b+c)>a)//判断三条边
{
p=(a+b+c)/2;
Area(a,b,c,p);
}
else
{
printf("Input error");
}
return 0;
}
void Area(float a,float b,float c,float p)
{
float sum=0;
sum=sqrt(p*(p-a)*(p-b)*(p-c));
printf("The area is :%f\n",sum);
}
在VC6.0上面运行通过
全部回答
- 1楼网友:笑迎怀羞
- 2021-05-11 02:28
圆的边长?是什么?
- 2楼网友:蕴藏春秋
- 2021-05-11 02:01
饭客网络,这里有专业的编程语言团队为您服务!!
- 3楼网友:三千妖杀
- 2021-05-11 01:27
已知圆的三条边,大哥。。。圆啊。。。
给你写下框架吧~~!!
#include<stdio.h>
float fun(float a,flaot b,float c)
{return __________;
}
int main()
{float a,b,c,s;
s=fun(a,b,c);
printf("%f",s);
return 0;
}
(做任务中,希望我的回答满意~)
- 4楼网友:慢性怪人
- 2021-05-11 00:26
```圆有3个边啊,原来我一直还蒙在鼓里````
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯