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

1001ac代码,看了你也许会郁闷

Posted by Insistent at 2008-09-21 15:41:51
In Reply To:为什么一直说我Answer Wrong 呢?(1001题)结果都对的啊。。。 Posted by:jadeback at 2008-09-21 14:32:15
#include <iostream>
#include <cmath>
using namespace std;
double x,y,l,d;
double pi=acos(-1.0);
int main()
{
    double ca,sa;
    double t;
    double mt;
    double i;
    while(scanf("%lf%lf%lf%lf",&x,&y,&l,&d)!=EOF){
        i=0.1;
        mt=10000000000.0;
        while(i<=90.0)
        {
            ca=cos(i*pi/180.0);
            sa=sin(i*pi/180.0);
            t=(y-d*ca)/sa+(x-d*sa)/ca;
            if(t<mt)mt=t;
            i+=0.01;
        }
        if(mt>=l){printf("yes\n");}
        else printf("no\n");
    }
    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