#include <stdio.h>
#include <math.h>
typedef struct {
double a;
double b;
double c;
} Triangle;
double calculate_area(Triangle t) {
double p = (t.a + t.b + t.c) / 2;
return sqrt(p
* (p
- t.
a) * (p
- t.
b) * (p
- t.
c)); }
int main() {
Triangle t;
double area = calculate_area(t);
printf(" a : %.lf\n b : %.lf\n c : %.lf\n", t.
a, t.
b, t.
c); printf("三角形の面積: %.6f\n", area
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+Cgp0eXBlZGVmIHN0cnVjdCB7CiAgICBkb3VibGUgYTsKICAgIGRvdWJsZSBiOwogICAgZG91YmxlIGM7Cn0gVHJpYW5nbGU7Cgpkb3VibGUgY2FsY3VsYXRlX2FyZWEoVHJpYW5nbGUgdCkgewogICAgZG91YmxlIHAgPSAodC5hICsgdC5iICsgdC5jKSAvIDI7CiAgICByZXR1cm4gc3FydChwICogKHAgLSB0LmEpICogKHAgLSB0LmIpICogKHAgLSB0LmMpKTsKfQoKaW50IG1haW4oKSB7CiAgICBUcmlhbmdsZSB0OwogICAgCiAgICBzY2FuZigiJWxmIiwgJnQuYSk7CiAgICBzY2FuZigiJWxmIiwgJnQuYik7CiAgICBzY2FuZigiJWxmIiwgJnQuYyk7CgogICAgZG91YmxlIGFyZWEgPSBjYWxjdWxhdGVfYXJlYSh0KTsKCiAgICBwcmludGYoIiBhIDogJS5sZlxuIGIgOiAlLmxmXG4gYyA6ICUubGZcbiIsIHQuYSwgdC5iLCB0LmMpOwogICAgcHJpbnRmKCLkuInop5LlvaLjga7pnaLnqY06ICUuNmZcbiIsIGFyZWEpOwoKICAgIHJldHVybiAwOwp9Cg==