题目链接:https://vjudge.net/problem/UVALive-7013
#include <bits/stdc++.h>
using namespace std;
string s[20] = {"White", "Silver","Gray", "Black", "Red", "Maroon", "Yellow", "Olive", "Lime", "Green", "Aqua", "Teal", "Blue", "Navy", "Fuchsia", "Purple"};
int A[20][3] = {{255,255,255},
{192,192,192},
{128,128,128},
{0,0,0},
{255,0,0},
{128,0,0},
{225,255,0},
{128,128,0},
{0,255,0},
{0,128,0},
{0,255,255},
{0,128,128},
{0,0,255},
{0,0,128},
{255,0,255},
{128,0,128}
};
int main(){
int r, g, b;
while(~scanf("%d%d%d", &r, &g, &b)){
if(r == -1 && g == -1 && b == -1)
break;
int mini;
double mind = 2147483647;
for(int i = 0; i < 16; i++){
double d = sqrt((A[i][0] - r)*(A[i][0] - r) + (A[i][1] - g)*(A[i][1] - g) + (A[i][2] - b)*(A[i][2] - b));
if(d < mind){
mind = d;
mini = i;
}
}
cout << s[mini] << endl;
}
return 0;
}