#include <stdio.h> #include <math.h> #define N 5 int main() { int X, Y, x[N], y[N], hp[N], L; float R, d[N]; int k = 0; while(scanf("%d %d", &X, &Y) != EOF) { for(int i = 0; i < 5; i++) scanf("%d %d %d", &x[i], &y[i], &hp[i]); scanf("%d %f", &L, &R); for(i = 0; i < 5; i++) { d[i] = (float)sqrt((x[i] - X) * (x[i] - X) + (y[i] - Y) * (y[i] - Y)); if(d[i] <= L && d[i] * R >= hp[i]) k++; } if(k != 0) printf("YES\n"); else printf("NO\n"); } return 0; } /* Main.c: In function 'main': Main.c:14:7: error: 'i' undeclared (first use in this function) for(i = 0; i < 5; i++) ^ Main.c:14:7: note: each undeclared identifier is reported only once for each function it appears in Main.c:7:11: warning: variable 'd' set but not used [-Wunused-but-set-variable] float R, d[N]; ^ */ |
Double click to view unformatted code.