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 1427 at 2007-10-02 10:53:41 on Problem 3407
#include <iostream>
#include <math.h>

#define pi 3.1415926535897932384626433832795

using namespace std;

double weidu[20],weifen[20],jingdu[20],jingfen[20];
double x,y;
double jl;
double ans;
char nanb[20],dongx[20];

int main ()
{
    cin>>weidu[1]>>weifen[1]>>nanb[1]>>jingdu[1]>>jingfen[1]>>dongx[1];
    cin>>weidu[2]>>weifen[2]>>nanb[2]>>jingdu[2]>>jingfen[2]>>dongx[2];
    if (nanb[1]==nanb[2]) {
                          x=(weidu[1]+weifen[1]/60)-(weidu[2]+weifen[2]/60);
                          }
                          else {
                               x=(weidu[1]+weifen[1]/60)+(weidu[2]+weifen[2]/60);
                               }
    if (dongx[1]==dongx[2]) {
                            y=(jingdu[1]+jingfen[1]/60)-(jingdu[2]+jingfen[2]/60);
                            }
                            else {
                                 y=(jingdu[1]+jingfen[1]/60)+(jingdu[2]+jingfen[2]/60);
                                 }
   x=x/178*pi*6370;
   y=y/358*pi*6370;
   jl=sqrt(x*x+y*y);
   printf ("%0.3f\n",jl);
   //cout<<x<<endl<<y<<endl;
   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