Home > Back-end >  Classification of triangle rescue
Classification of triangle rescue

Time:10-19

Give all three lines a, b, ca, b, ca, b, c, the length of the both is not greater than 10000 integer, going to the spelling of all three lines into a triangle, it can be a triangle?

If can Not form a triangle of all three lines, output Not triangle;
If it is a Right triangle, the output Right triangle;
If Acute triangle, output Acute triangle;
If it is a Obtuse triangle, output Obtuse triangle;
If it is Isosceles triangle, the output Isosceles triangle.
If it is an Equilateral triangle, the output Equilateral triangle,

If the triangle in multiple conditions above, please output respectively, separated by a newline,


 # include & lt; stdio.h> 
Int main ()
{
Unsigned long long int a, [3].
int i,j;

for(i=0; i<3; I++)
{
The scanf (" % d ", & amp; A [I]);
}

Int x=3;
for(i=1; i<3; I++)
{
for(j=1; J{
Int temp=a, [j].
If (a [j] <- 1 a [j])
{
A [j]=a, [1].
- 1 a [j]=temp;
}
}
X -;
}
If (a [0] + [1] a & lt;=a [2])
{
Printf (" Not triangle \ n ");
}
The else
{
for(i=0; i<3; I++)
{
A [I]=a * [I] a [I];
}

If ((a [0] + [1] a) & lt; A [2])
{
Printf (" Obtuse triangle \ n ");
}
If ((a [0] + [1] a)==a [2])
{
Printf (" Right triangle \ n ");
}
If ((a [0] + [1] a) & gt; A [2])
{
Printf (" Acute triangle \ n ");
}
If (a [0]==a [1] | | a [1]==a [2])
{
Printf (" Isosceles triangle \ n ");
}
If (a [0]==a [1] & amp; & A [1]==a [2])
{
Printf (" Equilateral triangle \ n ");
}
}
return 0;
}
  • Related