[Plain] Description
After reading three non-zero integers, determine whether these three values can represent the three sides of a right triangle.
Input
The first line is the number of test data groups n. There are n rows below. Each row is a space-separated integer of the int type, representing the three sides of the triangle.
Output
The output is n rows, corresponding to the input result of n rows. Determine whether the input three values can represent the three sides of a right triangle. If the input value can be 1, if the input value cannot be 0.
Sample Input
2
3 4 5
5 6 1
Sample Output
1
0
Description
After reading three non-zero integers, determine whether these three values can represent the three sides of a right triangle.
Input
The first line is the number of test data groups n. There are n rows below. Each row is a space-separated integer of the int type, representing the three sides of the triangle.
Output
The output is n rows, corresponding to the input result of n rows. Determine whether the input three values can represent the three sides of a right triangle. If the input value can be 1, if the input value cannot be 0.
Sample Input
2
3 4 5
5 6 1
Sample Output
1
0
[Plain] # include <stdio. h>
Main ()
{
Int n;
Int;
Int B;
Int c;
Scanf ("% d", & n );
While (n --)
{
Scanf ("% d", & a, & B, & c );
If (a> 0 & B> 0 & c> 0)
{
If (a + B> c & B + c> a & a + c> B)
{
If (a * a + B * B = c * c | a * a + c * c = B * B | B * B + c * c = *)
{
Printf ("1 ");
}
Else
{
Printf ("0 ");
}
}
Else
{
Printf ("0 ");
}
}
Else
{
Printf ("0 ");
}
If (n> 0)
Printf ("\ n ");
}
}
# Include <stdio. h>
Main ()
{
Int n;
Int;
Int B;
Int c;
Scanf ("% d", & n );
While (n --)
{
Scanf ("% d", & a, & B, & c );
If (a> 0 & B> 0 & c> 0)
{
If (a + B> c & B + c> a & a + c> B)
{
If (a * a + B * B = c * c | a * a + c * c = B * B | B * B + c * c = *)
{
Printf ("1 ");
}
Else
{
Printf ("0 ");
}
}
Else
{
Printf ("0 ");
}
}
Else
{
Printf ("0 ");
}
If (n> 0)
Printf ("\ n ");
}
}