zzulioj 1030: Determine right triangle

Title description
Enter three positive integers and judge whether the three integers can be used as the side length to form a right triangle.
Enter
Enter three positive integers. Whether the
output
can form a right triangle. If it can output: yes. If it cannot, output: no.
Sample input Copy
6 8 10
Sample output Copy
yes

#include<stdio.h>
int main()
{
    
    
	int a, b, c;
	scanf("%d%d%d",&a,&b,&c);
	if(a+b>c&&a+c>b&&b+c>a&&(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a))
		  printf("yes\n");
	else 
	  printf("no\n");
	return 0;
}

Guess you like

Origin blog.csdn.net/m0_53024529/article/details/112845560