Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么我下面运行都对,但就是不被接受呢?求救!!!!#include<stdio.h> void main(){ int r,g,b,a[16][3],i,j,k=0,n; int d[16], min; for(i=0;i<16;i++){ for(j=0;j<3;j++){ scanf("%d",&a[i][j]); } } scanf("%d%d%d",&r,&g,&b); while(r!=-1&&g!=-1&&b!=-1){ for(n=0;n<16;n++){ d[n]=(r-a[n][0])*(r-a[n][0])+(g-a[n][1])*(g-a[n][1])+(b-a[n][2])*(b-a[n][2]); } min=d[0]; for(n=0;n<16;n++){ if(d[n]<min){ min=d[n]; k=n; } } printf("(%d,%d,%d)maps to(%d,%d,%d)\n",r,g,b,a[k][0],a[k][1],a[k][2]); scanf("%d%d%d",&r,&g,&b); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator