| ||||||||||
| 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 | |||||||||
1046 麻烦了#include<stdio.h>
void main(){
int x[100],y[100],z[100],t[100];
int i,j,a,b,c;
for(i=1;i<17;i++)
scanf("%d %d %d",&x[i],&y[i],&z[i]);
scanf("%d %d %d",&a,&b,&c);
while(a!=-1&&b!=-1&&c!=-1){
int n;
for(i=1;i<=16;i++)
t[i]=(a-x[i])*(a-x[i])+(b-y[i])*(b-y[i])+(c-z[i])*(c-z[i]);
for(i=2;i<=16;i++)
if(t[1]>t[i]){
j=t[1];
t[1]=t[i];
t[i]=j;
n=i;
}
printf("(%d,%d,%d) maps to (%d,%d,%d)\n",a,b,c,x[n],y[n],z[n]);
scanf("%d %d %d",&a,&b,&c);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator