#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;
}
//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 topCodePudding user response:
Hard, more objective and kCodePudding user response:
A good algorithm! Praise a!CodePudding user response:
Thank you, I feel is not good enough!