ZJU1067- Color Me Less
来源:互联网 发布:出租屋 知乎 编辑:程序博客网 时间:2024/04/29 10:14
输出换行……
测试数据:
0 0 0
255 255 255
0 0 1
1 1 1
128 0 0
0 128 0
128 128 0
0 0 128
126 168 9
35 86 34
133 41 193
128 0 128
0 128 128
128 128 128
255 0 0
0 1 0
0 0 0
255 255 255
253 254 255
77 79 134
81 218 0
-1 -1 -1
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int s[999][4]={0};
float f[18]={0};
int main()
{
int a,b,c,i;
float d;
for(i=0;i<16;i++){
cin>>s[i][0]>>s[i][1]>>s[i][2];
}
while(cin>>a>>b>>c&&a!=-1){
for(i=0;i<16;i++){
f[i]=sqrt((a-s[i][0])*(a-s[i][0])+(b-s[i][1])*(b-s[i][1])+(c-s[i][2])*(c-s[i][2]));
}
int minm=f[0],g=0;
for(i=0;i<16;i++){
if(f[i]<minm){
minm=f[i];
g=i;
}
}
printf("(%d,%d,%d) maps to (%d,%d,%d)\n",a,b,c,s[g][0],s[g][1],s[g][2]);
}
return 0;
}
- ZJU1067- Color Me Less
- 1046 Color Me Less
- 1067 Color Me Less
- ZOJ1067 Color Me Less
- JOJ1090: Color Me Less
- 1046 Color Me Less
- 1046 Color Me Less
- acm1067-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
- 1046 Color Me Less
- Color Me Less
- Color Me Less(POJ1046
- 03-SSH server config
- hdu 3308 LCIS
- APP开发外包注意事项有哪些?
- Centos搭建SVN服务器及配置文件(主要讲配置)
- hadoop - hadoop2.6 伪分布式 示例 wordcount 分词 和 hdfs常用操作命令
- ZJU1067- Color Me Less
- 2016 GDUT Individual Contest2_A题_codeforces 416A(双指针)
- caffe示例实现之13编辑模型参数
- 用win 7 32位 cmake2.8+VTK6.2+VS2012配置
- 从Android开发环境搭建开始
- C语言:实现数据的四舍五入
- 抽奖代码
- iOS程序的执行流程和响应者链的关系
- oc的MRC和ARC的区别