📄 2409251_wa.c
字号:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define Zero 1e-2
#define PI (2.0*asin(1))
int main()
{
double l1, l2, l3;
double a1, a2, a3;
double x1, x2, x3, y1, y2, y3;
//freopen("aa.in","r",stdin);
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)==6)
{
l1 = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
l2 = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
l3 = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
if(l1+l2-l3<=0||l1+l3-l2<=0||l3+l2-l1<=0)
{
printf("Not a Triangle\n");
continue;
}
if((fabs(l1-l2)<=Zero)&&(fabs(l3-l2)<=Zero))
{
printf("Equilateral ");
goto ang;
}
if((fabs(l1-l2)<=Zero)||(fabs(l3-l2)<=Zero))
{
printf("Isosceles ");
goto ang;
}
printf("Scalene ");
ang:;
a1 = acos((l2*l2+l3*l3-l1*l1)/(2.0*l2*l3))*180.0/PI;
a2 = acos((l1*l1+l3*l3-l2*l2)/(2.0*l1*l3))*180.0/PI;
a3 = acos((l2*l2+l1*l1-l3*l3)/(2.0*l2*l1))*180.0/PI;
//printf("%lf %lf %lf %lf %lf %lf\n",l1,l2,l3,a1,a2,a3);
if(a1-92>0||a2-92>0||a3-92>0)
{
printf("Obtuse\n");
continue;
}
if(a1-88<0&&a2-88<0&&a3-88<0)
{
printf("Acute\n");
continue;
}
printf("Right\n");
}
printf("End of Output\n");
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -