三角形分类

#include
int main()
{
	double a = 0 && a < 10000;
	double b = 0 && b < 10000;
	double c = 0 && c < 10000;
	scanf("%lf %lf %lf", &a, &b, &c);
	if (a + b > c && a + c > b && b + c > a)
	{
		 if (a*a + b * b == c * c)
			printf("Right triangle\n");
		 if (a * a + b * b > c * c)
			printf("Acute triangle\n");
		 else if (a * a + b * b < c * c)
			printf("Obtuse triangle\n");
		 if (a == b || a == c || b == c)
			printf("Isosceles triangle\n");
		 if (a == b == c)
			 printf("Equilateral triangle\n");
	}
	else
		printf("Not triangle\n");
	return 0;
}

你可能感兴趣的:(算法)