题意:

汽车在(0,r)的位置上,现在在离汽车顺时针角度为z度的地方发生一起车祸,问汽车能否赶到那里。已知汽车开始共有n升油,一升油能跑5米。
注意degree取z,360-z的较小值即可。
直接直接贴代码了。。
1
# include <stdio.h>
2
# include <string.h>
3
# define PI 3.14159
4
# define min(a,b) ((a)<(b)?(a):(b))
5
int main()
6

{
7
char str[20];
8
while(1)
9
{
10
int r,amount,degree;
11
scanf("%s",str);
12
if(!strcmp(str,"ENDOFINPUT")) break;
13
scanf("%d%d%d",&r,&amount,°ree);
14
scanf("%s",str);
15
double req=2*PI*r/360.0*min(degree,360-degree)*2;
16
if(amount*5.0-req>-1e-8)
17
printf("YES %d\n",(int)(amount-req/5.0+1e-8));
18
else
19
printf("NO %d\n",amount*5);
20
21
}
22
return 0;
23
}
24