文章
21
粉丝
76
获赞
1
访问
13.2k
#include <stdio.h>
int main() {
int T;
scanf("%d", &T);
while (T--) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
// Check if the triangle is valid
if (a + b > c && a + c > b && b + c > a) {
// Determine triangle type
if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a)
printf("2\n"); // Right angled triangle
else if (a * a + b * b < c * c || a * a + c * c < b * b || b * b + c * c < a * a)
printf("3\n"); // Obtuse angled triangle
...
登录后发布评论
暂无评论,来抢沙发