-->
当前位置:首页 > 题库 > 正文内容

程序填空题:Triangle area_1

Luz4年前 (2021-05-10)题库560
The function of this program is to calculate triangle area from inputed 3 sides. The question guaranteed the 3 sides will constitude a triangle. Input 3 floating numbers in one line, separate each other by ','. The output holds 2 fraction digits and print "The area is `area`".

Sample Input:
```
3.5,2,5.3
```

Sample Output:
```
The area is 1.87
```

```c
#include
@@[#include](1)
int main()
{
double a,b,c,s,area;
scanf@@[("%lf,%lf,%lf",&a,&b,&c);](2)
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf@@[("The area is %.2f",area);](2)
return 0;
}

```






答案:
第1空:#include

第2空:("%lf,%lf,%lf",&a,&b,&c);

第3空:("The area is %.2f",area);

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。