| ||||||||||
| 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 | |||||||||
1001ac代码,看了你也许会郁闷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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator