##代码大部分对,但是只能判断一次(一次只输出一种) 本蒟蒻在这里请教一下各位神犇##
//yee
#include <iostream>
#include <cmath>
using namespace std;
int d(int a, int b, int c) {
int max = a;
if (b > max) {
max = b;
}
if (c > max) {
max = c;
}
return max;
}
string sjxpd(int a, int b, int c) {
int max = d(a, b, c);
int sum = a*a + b*b + c*c - max*max;
if (a <= 0 || b <= 0 || c <= 0) {
return "Not triangle";
if (a + b <= c || a + c <= b || b + c <= a) {
return "Not triangle";
//等腰,等边三角形
if (a == b && b == c) {
return "Equilateral triangle";
if (a == b || a == c || b == c) {
return "Isosceles triangle";
//锐角,钝角,直角三角形
if (pow(max, 2) > sum) {
return "Obtuse triangle";
if (pow(max, 2) < sum) {
return "Acute triangle";
if (pow(max, 2) == sum) {
return "Right triangle";
}
}
}
}
}
}c
}
}
int main() {
int s1, s2, s3;
cin >> s1 >> s2 >> s3;
string t = sjxpd(s1, s2, s3);
cout << t << endl;
return 0;
}
本蒟蒻第一次发讨论,如果哪里错了请指出
ps我们那个题的讨论区不太活跃,我看灌水区挺活跃的,就发过来了,因为我校教练然赶紧做,