View Code of Problem 32

#include<stdio.h>
#include<math.h>


void main()
{ 
	  int x0,y0,x[5],y[5],h[5],L,a=0,i;
    float s,R;

for(;scanf("%d",&x0)!=EOF;)
{	
   scanf(" %d",&y0);
     for(i=0;i<5;i++)  {scanf("%d %d %d",&x[i],&y[i],&h[i]);}
   scanf("%d %f",&L,&R);
	for(i=0;i<5;i++)
	{ s=sqrt(    (  abs(y0-y[i])*abs(y0-y[i])+  (abs(x0-x[i])*abs(x0-x[i]) )  ));
      if(L>s)
		{if(R*L>=h[i]) a++;} 
	}
   if (a>0)
 printf("Yes\n");
 else 
 printf("No\n");
}
/*
Main.c:5:6: warning: return type of 'main' is not 'int' [-Wmain]
 void main()
      ^
Main.c: In function 'main':
Main.c:16:2: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
  { s=sqrt(    (  abs(y0-y[i])*abs(y0-y[i])+  (abs(x0-x[i])*abs(x0-x[i]) )  ));
  ^
Main.c:24:1: error: expected declaration or statement at end of input
 }
 ^
*/

Double click to view unformatted code.


Back to problem 32