#include <stdio.h>
#include <math.h>
int main() {
double a, b, c;
double s, area;
printf("3辺の長さを入力してください (a b c): "); scanf("%lf %lf %lf", &a
, &b
, &c
);
if (a + b > c && a + c > b && b + c > a) {
s = (a + b + c) / 2;
area
= sqrt(s
* (s
- a
) * (s
- b
) * (s
- c
));
printf("三角形の面積は: %.2f\n", area
); } else {
printf("入力された3辺では三角形を作ることができません。\n"); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgbWFpbigpIHsKICAgIGRvdWJsZSBhLCBiLCBjOwogICAgZG91YmxlIHMsIGFyZWE7CgogICAgcHJpbnRmKCIz6L6644Gu6ZW344GV44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GEIChhIGIgYyk6ICIpOwogICAgc2NhbmYoIiVsZiAlbGYgJWxmIiwgJmEsICZiLCAmYyk7CgogICAgaWYgKGEgKyBiID4gYyAmJiBhICsgYyA+IGIgJiYgYiArIGMgPiBhKSB7CiAgICAgICAgcyA9IChhICsgYiArIGMpIC8gMjsKCiAgICAgICAgYXJlYSA9IHNxcnQocyAqIChzIC0gYSkgKiAocyAtIGIpICogKHMgLSBjKSk7CgogICAgICAgIHByaW50Zigi5LiJ6KeS5b2i44Gu6Z2i56mN44GvOiAlLjJmXG4iLCBhcmVhKTsKICAgIH0gZWxzZSB7CiAgICAgICAgcHJpbnRmKCLlhaXlipvjgZXjgozjgZ8z6L6644Gn44Gv5LiJ6KeS5b2i44KS5L2c44KL44GT44Go44GM44Gn44GN44G+44Gb44KT44CCXG4iKTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQo=