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 |
Re:这个程序怎么还是不行In Reply To:这个程序怎么还是不行 Posted by:211211 at 2003-12-15 12:21:00 > #include <stdio.h> > #include <math.h> > void main() > { int a[16][3], b[3],c[16],i,j, k,n ; > 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]=int((a[i][0]-b[0])*(a[i][0]-b[0])+(a[i][1]-b[1])*(b[i][1]-b[1])+(a[i][2]-b[2])*(a[i][2]-b[2]));} > for(i=0;i<15;i++){ > for(j=j+1;j<16;j++) > { > if (c[i]>c[j]) n=j;} > } > printf("(%d,%d,%d) maps to (%d,%d,%d)\n", a[n][0],a [n][1],a [n][2]); > for(k=0;k<3;k++) > {scanf("%d",b[k]) ;} > } > } > 它说{c[i]=int((a[i][0]-b[0])*(a[i][0]-b[0])+(a[i][1]-b[1])*(b[i][1]-b[1])+(a[i][2]-b[2])*(a[i][2]-b > 这一行有问题,拜托改一下,谢谢 > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator