var x1,y1,x2,y2,x3,y3,x4,y4,q1,q2:longint;s1,s2,s3:real;
begin
assign(input, 'input.txt');reset(input);
assign(output, 'output.txt');rewrite(output);
readln(x1,y1,x2,y2,x3,y3);
s1:=sqrt(sqr(x1-x2)+sqr(y1-y2));
s2:=sqrt(sqr(x3-x2)+sqr(y3-y2));
s3:=sqrt(sqr(x1-x3)+sqr(y1-y3));
if (s1>s2)and(s1>s3) then begin q1:=x2;q2:=y2;x2:=x3;y2:=y3;x3:=q1;y3:=q2; end;
if (s2>s3)and(s2>s1) then begin q1:=x2;q2:=y2;x2:=x1;y2:=y1;x1:=q1;y1:=q2; end;
x4:=x3-x2+x1;
y4:=y3-y2+y1;
writeln(x4,' ',y4);
end.
182 на acmp.ru
Страница: 1
Сообщений 1 страница 2 из 2
Поделиться12011-06-22 12:41:06
Поделиться22011-06-22 12:53:20
var m,n,k:integer;
x,y:array [1..3] of longint;
r1,r2,r3:real;
begin
assign(input, 'input.txt'); reset(input);
assign(output, 'output.txt'); rewrite(output);
for m:=1 to 3 do
read(x[m],y[m]);
r1:=sqrt(sqr(x[1]-x[2])+sqr(y[1]-y[2]));
r2:=sqrt(sqr(x[2]-x[3])+sqr(y[2]-y[3]));
r3:=sqrt(sqr(x[3]-x[1])+sqr(y[3]-y[1]));
if (r3>r1) and (r3>r2) then write(x[3]-x[2]+x[1],' ',y[3]-y[2]+y[1]);
if (r2>r1) and (r2>r3) then write(x[3]-x[1]+x[2],' ',y[3]-y[1]+y[2]);
if (r1>r3) and (r1>r2) then write(x[2]-x[3]+x[1],' ',y[2]-y[3]+y[1]);
end.
Страница: 1