Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 神贴留名

Posted by hsujamy at 2010-08-24 19:58:40 on Problem 1046
In Reply To:有硕士博士吗,同等学力的也进来帮帮我,为什么VC能通过提交总是wrong anwser Posted by:winter_1 at 2006-04-23 22:22:27
> #include<stdio.h>
> void main()
> {
> 	struct color{
> 		int a;
> 		int b;
> 		int c;
> 	};
> 	struct color vb[16];
> 	int i,k1,k2,k3,t1,t2,t3,min=0;
> 	for(i=0;i<16;i++){
> 		scanf("%d %d %d",&vb[i].a,&vb[i].b,&vb[i].c);
> 	}
> 	int x,y,z;
> 	while(1){
> 		scanf("%d %d %d",&x,&y,&z);
> 		if(x==-1&&y==-1&&z==-1){
> 			break;
> 		}
> 		for(i=1;i<16;i++){
> 			k1=x-vb[min].a;
> 			k2=y-vb[min].b;
> 			k3=z-vb[min].c;
> 			t1=x-vb[i].a;
> 			t2=y-vb[i].b;
> 			t3=z-vb[i].c;
> 			if(k1*k1+k2*k2+k3*k3>t1*t1+t2*t2+t3*t3){
> 				min=i;
> 			}
> 		}
>
> 		printf("(%d,%d,%d) maps to (%d,%d,%d)\n",x,y,z,vb[min].a,vb[min].b,vb[min].c);
>
> 	}
> }
>

Followed by: