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

Re:我只是见了好多大牛的名字,觉得我也该顶顶MOP贴

Posted by MDK at 2011-09-15 21:37:16 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:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator