| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
WA??Why? Does the It has some traps?program dps;
Var
A,B,C,x1,x2,y1,y2,x3,y3:Real;
CosA,CosB,CosC:Real;
begin
Read(x1);
While x1<>-1 do
begin
readln(y1,x2,y2,x3,y3);
A:=(y1-y2)*(y1-y2)+(x1-x2)*(x1-x2);
B:=(y1-y3)*(y1-y3)+(x1-x3)*(x1-x3);
C:=(y2-y3)*(y2-y3)+(x2-x3)*(x2-x3);
C:=round(C);
B:=round(B);
A:=round(A);
if (sqrt(A)+sqrt(B)<=sqrt(C))OR(sqrt(A)+sqrt(C)<=sqrt(B))or(sqrt(B)+sqrt(C)<=sqrt(A)) then writeln('Not a Triangle') else
if (abs(sqrt(A)-sqrt(C))>=sqrt(B))OR(abs(sqrt(B)-sqrt(C))>=sqrt(A)) then writeln('Not a Triangle') else
if (abs(sqrt(A)-sqrt(B))>=sqrt(C)) then writeln('Not a Triangle') else
begin
cosC:=A+B-C;
cosA:=B+C-A;
cosB:=C+A-B;
if (A=B)And(A=C) then write('Equilateral ') else
if (A=B)or(B=C)or(C=A) then write('Isosceles ') else
write('Scalene ');
if (cosA<0)or(cosB<0)or(cosC<0) then writeln('Obtuse') else
if (cosA=0)or(cosB=0)or(cosC=0) then writeln('Right') else
if (cosA>0)and(cosB>0)and(cosC>0) then writeln('Acute');
end;
read(x1);
end;
writeln('End of Output');
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator