看前点赞
考试必有惊喜
#include <stdio.h>
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
int L1, L2, L3;
int x1, x2, x3;
int y1, y2, y3;
cin >> x1 >> y1;
cin >> x2 >> y2;
cin >> x3 >> y3;
L1 = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
L2 = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
L3 = sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
if (L1 + L2 > L3&& L1 - L2 < L3)
{
if (L1 == L2 || L1 == L3 || L2 == L3)
cout << "该图形为等腰三角形" << endl;
else
cout << "该图形为三角形" << endl;
}
else
cout << "该图形不为三角形" << endl;
system("pause");
return 0;
}
学生创作不对勿喷