Home > Back-end >  Strives for the triangle area, post for the first time
Strives for the triangle area, post for the first time

Time:10-26

#include
#include
using namespace std;
# define s (a, b, c) (a + b + c)/2
# define area (a, b, c) SQRT (s (a, b, c) * (s (a, b, c) - a) * (s (a, b, c) - b) * (s (a, b, c) - c))
Int main ()
{
Float a, b, c;
Cout<& lt;" Input a, b, c: ";
Cin> A> B> c;
If (a + b> C& & A + c> B& & B + c> A)
Cout<& lt;" Area="& lt; The else
Cout<& lt;" It is not a triangle "& lt; return 0;
}
//the area of a triangle,

CodePudding user response:

Quite good... A good algorithm.

CodePudding user response:

The inside of the macro parameters had better use parentheses, such as:
# define s (a, b, c) ((a) + (b) + (c))/2

CodePudding user response:

Friendship up top

CodePudding user response:

Hard, more objective and k

CodePudding user response:

A good algorithm! Praise a!

CodePudding user response:

Thank you, I feel is not good enough!
  • Related