#include <stdio.h>
#include <math.h>
// 三角形の構造体を定義
typedef struct {
double a; // 1つ目の辺の長さ
double b; // 2つ目の辺の長さ
double c; // 3つ目の辺の長さ
double area; // 三角形の面積
} list;
int main(void) {
// 構造体変数を宣言
list date;
// 辺の長さを設定
date.a = 5.0;
date.b = 5.0;
date.c = 5.0;
// 半周の計算
double s = (date.a + date.b + date.c) / 2.0;
// ヘロンの公式で面積を計算
date.
area = sqrt(s
* (s
- date.
a) * (s
- date.
b) * (s
- date.
c));
// 結果の出力
printf("三角形の面積 : %lf\n", date.
area);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgovLyDkuInop5LlvaLjga7mp4vpgKDkvZPjgpLlrprnvqkKdHlwZWRlZiBzdHJ1Y3QgewogICAgZG91YmxlIGE7IC8vIDHjgaTnm67jga7ovrrjga7plbfjgZUKICAgIGRvdWJsZSBiOyAvLyAy44Gk55uu44Gu6L6644Gu6ZW344GVCiAgICBkb3VibGUgYzsgLy8gM+OBpOebruOBrui+uuOBrumVt+OBlQogICAgZG91YmxlIGFyZWE7IC8vIOS4ieinkuW9ouOBrumdouepjQp9IGxpc3Q7CgppbnQgbWFpbih2b2lkKSB7CiAgICAvLyDmp4vpgKDkvZPlpInmlbDjgpLlrqPoqIAKICAgIGxpc3QgZGF0ZTsKCiAgICAvLyDovrrjga7plbfjgZXjgpLoqK3lrpoKICAgIGRhdGUuYSA9IDUuMDsKICAgIGRhdGUuYiA9IDUuMDsKICAgIGRhdGUuYyA9IDUuMDsKCiAgICAvLyDljYrlkajjga7oqIjnrpcKICAgIGRvdWJsZSBzID0gKGRhdGUuYSArIGRhdGUuYiArIGRhdGUuYykgLyAyLjA7CgogICAgLy8g44OY44Ot44Oz44Gu5YWs5byP44Gn6Z2i56mN44KS6KiI566XCiAgICBkYXRlLmFyZWEgPSBzcXJ0KHMgKiAocyAtIGRhdGUuYSkgKiAocyAtIGRhdGUuYikgKiAocyAtIGRhdGUuYykpOwoKICAgIC8vIOe1kOaenOOBruWHuuWKmwogICAgcHJpbnRmKCJhIDogJWxmXG4iLCBkYXRlLmEpOwogICAgcHJpbnRmKCJiIDogJWxmXG4iLCBkYXRlLmIpOwogICAgcHJpbnRmKCJjIDogJWxmXG4iLCBkYXRlLmMpOwogICAgcHJpbnRmKCLkuInop5LlvaLjga7pnaLnqY0gOiAlbGZcbiIsIGRhdGUuYXJlYSk7CgogICAgcmV0dXJuIDA7Cn0=