SDUT1047Color Me Less
来源:互联网 发布:淘宝手游充值 编辑:程序博客网 时间:2024/05/16 11:40
#include<cstdio>#include<cstring>#include<cstdlib>#include<cmath>#include<iostream>#define MAX 0x3f3f3fusing 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); }}
0 0
- SDUT1047Color Me Less
- 1046 Color Me Less
- 1067 Color Me Less
- ZOJ1067 Color Me Less
- JOJ1090: Color Me Less
- 1046 Color Me Less
- ZOJ1067Color Me Less
- 1046 Color Me Less
- ZOJ_1067_Color Me Less
- acm1067-Color Me Less
- 1067_Color Me Less
- poj_1046 Color Me Less
- poj1046 color me less
- AOJ186 Color Me Less
- POJ1046;Color me less
- poj1046--Color Me Less
- Color Me Less
- Color Me Less
- HashSet、HashMap、ArrayList、LinkedList、Vector区别
- linux ls -l 详解
- POJ3080——Blue Jeans
- C++对象模型的那些事儿之六:成员函数调用方式
- About
- SDUT1047Color Me Less
- Android PopupWindow 点击消失解决办法
- 动态规划之背包问题(一)
- 数据挖掘学习书籍推荐 2
- Android中的AlarmManager的使用
- 第一章 vagrant简介--Alternatives to Vagrant(5)
- 模仿淘宝上提加载图文详情的功能
- caffe中solver.prototxt参数说明
- 繁忙的都市