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 |
PASCAL!ar a,b,c:array[1..16] of integer; x,y,z,i,aa,bb,cc:integer; s:array[1..16] of double; min:double; begin for i:=1 to 16 do readln(a[i],b[i],c[i]); readln(x,y,z); while (x<>-1)and(y<>-1)and(z<>-1) do begin min:=1000000; for i:=1 to 16 do begin s[i]:=sqrt(sqr(x-a[i])+sqr(y-b[i])+sqr(z-c[i])); if s[i]<min then begin aa:=a[i]; bb:=b[i]; cc:=c[i]; min:=s[i]; end; end; writeln('(',x,',',y,',',z,') maps to (',aa,',',bb,',',cc,')'); readln(x,y,z); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator