Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

WA??Why? Does the It has some traps?

Posted by vxk at 2003-11-12 18:05:33 on Problem 1586
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator