Problem description :

Enter the length of the three sides , If these three sides can form a triangle , Area of output triangle ( Keep after decimal point 6 position ) And type , Otherwise output “ Can't form a triangle ”

PS:

Detect triangle types from top to bottom , As long as there's one satisfaction, there's no need to test it , Direct output :

Equilateral triangle
an isosceles triangle
right triangle
Ordinary triangle

Reference code
#include <stdio.h> #include <math.h> int main() { double a, b, c, p, area;
scanf_s("%lf%lf%lf", &a, &b, &c); if (a + b > c && b + c > a && a + c > b)
// Only when the sum of any two sides is greater than the third side can a triangle be formed { p = (a + b + c) / 2;// Half the circumference area = sqrt(p * (p - a) *
(p - b) * (p - c));// Triangle area formula printf("%.6lf\n", area); if (a == b && b == c && a
== c)printf(" Equilateral triangle \n"); else if (a == b || b == c || a == c) printf(" an isosceles triangle \n");
else if (a * a + b * b == c * c) printf(" right triangle \n"); else printf(" Ordinary triangle \n"); }
else printf(" Can't form a triangle \n"); return 0; }
Operation results :

Technology
©2019-2020 Toolsou All rights reserved,
html Writing about cherry trees , Writing about cherry trees It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) Browser kernel ( understand )HashMap Explain in detail java Four functional interfaces ( a key , simple )os Simple use of module Some East 14 Pay change 16 salary , Sincerity or routine ?