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 123234345 at 2009-08-24 21:48:16 on Problem 2624
In Reply To:OLE 什么意思 帮帮忙<附原码> Posted by:d4114 at 2007-05-05 22:49:07
#include <stdio.h>
#include<math.h>
int main()
{
    double x[4],y[4];
    while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])!=EOF)
    {
          int mi=-1;
          for(int i=0;i<4;i++)
          {
               for(int j=i+1;j<4;j++)
                    if(fabs(x[i]-x[j])<1e-8&&fabs(y[i]-y[j])<1e-8)
                    {
                         mi=i;
                         break;
                    }
               if(mi!=-1) break;
          }
          double hx=x[0]+x[1]+x[2]+x[3],hy=y[0]+y[1]+y[2]+y[3];
          hx-=2*x[mi],hy-=2*y[mi];
          printf("%.3f %.3f\n",hx-x[mi],hy-y[mi]);
    }
}

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