题意不难理解,仔细看题吧,就不说题意了
#include#include #include #include using namespace std;const double PI=acos(-1.0);const double g=9.8;double V[205];int main(){ //freopen("in.txt","r",stdin); int n; while(scanf("%d",&n),n) { double H,L1,R1,L2,R2; memset(V,0,sizeof(V)); scanf("%lf%lf%lf%lf%lf",&H,&L1,&R1,&L2,&R2); for(int i=0; i =R1) printf("0\n"); else { int ans=0; double add=PI/1000; //一开始我是另add=0.001,虽然比PI/1000还小,然而无限wa。可能是样例所要求弧度是PI平均分割的,0.001精读比PI/1000小,例如(没验证),0.003不能打到敌方,而0.00314159....可以,但是0.004也不能打到敌方。 for(double i=-PI/2; i =L2 && x<=R2) { cou=0; break; } if(x>=L1 && x<=R1) cou++; } ans=ans>cou? ans:cou; } printf("%d\n",ans); } } return 0;}