#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#define MAX 0x3f3f3f
using namespace std;
struct node
{
double r,g,b;
} a[20];
double fd(struct node t,double x,double y,double z)
{
return sqrt((t.r-x)*(t.r-x)+(t.g-y)*(t.g-y)+(t.b-z)*(t.b-z));
}
int main()
{
int k;
for(int i=0; i<16; i++)
scanf("%lf%lf%lf",&a[i].r,&a[i].g,&a[i].b);
double x,y,z;
while(scanf("%lf%lf%lf",&x,&y,&z)&&x!=-1&&y!=-1&&z!=-1)
{
double d=MAX;
for(int i=0; i<16; i++)
if(fd(a[i],x,y,z)<d)
{
d=fd(a[i],x,y,z);
k=i;
}
printf("(%.0lf,%.0lf,%.0lf) maps to (%.0lf,%.0lf,%.0lf)\n",x,y,z,a[k].r,a[k].g,a[k].b);
}
}
SDUT1047Color Me Less
最新推荐文章于 2021-05-25 08:19:47 发布