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:为什么提交总是compile error 编译器里都正常

Posted by bin_der at 2011-04-19 10:39:17 on Problem 1046
In Reply To:为什么提交总是compile error 编译器里都正常 Posted by:bin_der at 2011-04-19 10:28:02
> #include<iostream>
> #include<math.h>
> using namespace std;
> 
> int main()
> {  
>     int a[16][3],b[3];
>     for(int i=0;i<16;i++)
>     cin>>a[i][0]>>a[i][1]>>a[i][2];
>     while(cin>>b[0]>>b[1]>>b[2],b[0]!=-1&&b[1]!=-1&&b[2]!=-1)
>     {
>        int c=0;
>        float min=0.0,k=0.0;
>        min=sqrt((a[0][0]-b[0])*(a[0][0]-b[0])+(a[0][1]-b[1])*(a[0][1]-b[1])+(a[0][2]-b[2])*(a[0][2]-b[2]));
>        for(int i=1;i<16;i++)
>        {   
>             k=sqrt((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]));
> 			if(min>k) 
>             {min=k;c=i;}
>        }
>      printf("(%d,%d,%d) maps to (%d,%d,%d)\n",b[0],b[1],b[2],a[c][0],a[c][1],a[c][2]);
>    }
>    //system("pause");
>    return 0;
> }

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