#include <stdio.h>
#include <stdlib.h>
#define NUM 16
int main()
{
int x[NUM],y[NUM],z[NUM];
int i,a,b,c,res;
double len1,len2;
for(i=0;i<16;i++)
scanf("%d %d %d",&x[i],&y[i],&z[i]);
while(scanf("%d %d %d",&a,&b,&c)==3)
{
if(a==-1&&b==-1&&c==-1)
return 0;
len1=(a-x[0])*(a-x[0])+(b-y[0])*(b-y[0])+(c-z[0])*(c-z[0]);
res=0;
for(i=1;i<16;i++)
{
len2=(a-x[i])*(a-x[i])+(b-y[i])*(b-y[i])+(c-z[i])*(c-z[i]);
if(len2<len1)
{
len1=len2;
res=i;
}
}
printf("(%d,%d,%d) maps to (%d,%d,%d)/n",a,b,c,x[res],y[res],z[res]);
}
return 0;
}
1046
最新推荐文章于 2020-09-24 16:22:14 发布