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

这个为什么不对啊?能帮忙看一下吗?谢谢!

Posted by zhugeljj at 2004-11-23 21:22:56 on Problem 1046
#include    <stdio.h>
#include    <math.h>
	 void  main(){
     int a[16][3], b[3],i,j, k;
     float c[16],max;
	for (i=0; i<16; i++)
         for (j=0;j<3;j++)
        {scanf("%d ",&a[i][j]);}
	for(k=0;k<3;k++)
        {scanf("%d",&b[k] );}
	for(b[0]&&b[1]&&b[2]!=0;;){
            for(i=0;i<16;i++)
	  {c[i]=(a[i][0]-b[0])*(a[i][0]-b[0])+(a[i][1]-b[1])*(a[i][1]-b[1])+(a[i][2]-b[2])*(a[i][2]-b[2]);}
         max=c[0];
	for(i=0;i<16;i++)
         {if (c[i]>max) max=c[i];}  
          printf("(%d,%d,%d) maps to (%d,%d,%d)\n",b[0],b[1],b[2],a[i][0],a[i][1],a[i][2]);
	 for(k=0;k<3;k++)
	{scanf("%d",b[k])  ;}
			}
	 	}

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