<>sqrt() Usage of functions , Find triangle area

I saw the triangle area when I brushed the questions today , It suddenly occurred to me that the teacher said , It's not easy ?
Just go straight to the code .
#include <stdio.h> int main() { float a = 0; float b = 0; float c = 0;// Three sides of a triangle
printf(" Enter the three sides of the triangle \n"); scanf("%f %f %f", &a, &b, &c); if (a + b > c && a + c > b
&& b + c > a) { float s = (a + b + c) / 2.0; float mianji = s * (s - a) * (s - b
) * (s - c);// Triangle area metric printf(" The area of the triangle is %.2f", mianji);// Output triangle area with two decimal places reserved } else {
printf(" The sum of triangles should be greater than the third side , Please re-enter the side length "); } return 0; }
And how to test it, but , Just go to see the teacher's homework. No problem ! Until I found the teacher's PPT Take a look ,???

Then I found that the teacher's question was the square of the triangle area , Then I was embarrassed to get a pen , I didn't think so much about Typing Code . I want to C How to square language , I found it on the Internet and solved it .
That is sqrt function ,sqrt Function needs #include<math.h> Perfect solution . The code is as follows
#include <stdio.h> #include <math.h>// use sqrt Header file required by function int main() { float a = 0;
float b = 0; float c = 0;// Three sides of a triangle printf(" Enter the three sides of the triangle \n"); scanf("%f %f %f", &a,
&b, &c); if (a + b > c && a + c > b && b + c > a) { float s = (a + b + c) / 2.0;
float mianji = sqrt(s * (s - a) * (s - b) * (s - c));// Triangle area metric ,sqrt() Function to open the square root
printf(" The area of the triangle is %.2f", mianji);// Output triangle area with two decimal places reserved } else { printf(
" The sum of triangles should be greater than the third side , Please re-enter the side length "); } return 0; }
Just two small changes , A little awkward .

Technology