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 |
难道有什么特殊情况!?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator