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 vikenlong at 2009-11-15 10:06:46
#include <stdio.h>

#include <math.h>

int main()
{
      float x1,y1,x2,y2,a,b;
      while(scanf("%f%f%f%f",x1,y1,x2,y2)!=EOF)      
      {                                               
       a=(x2-x1)*(x2-x1);             
       b=(y2-y1)*(y2-y1);           
       printf("%.2f\n",sqrt(a+b));      
      }      
      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