34 lines
741 B
C
34 lines
741 B
C
#include <stdio.h>
|
|
|
|
int inCircle(int centerX, int centerY, int posX, int posY) {
|
|
int x_distance = 0, y_distance = 0;
|
|
x_distance = centerX - posX;
|
|
y_distance = centerY - posY;
|
|
if (x_distance * x_distance + y_distance * y_distance <= 1) {
|
|
return 1;
|
|
}
|
|
else {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
int pos_x = 0 , pos_y = 0;
|
|
scanf("%d %d", &pos_x, &pos_y);
|
|
if (inCircle(2, 2, pos_x, pos_y)) {
|
|
printf("10m");
|
|
}
|
|
else if (inCircle(-2, 2, pos_x, pos_y)) {
|
|
printf("9m");
|
|
}
|
|
else if (inCircle(-2, -2, pos_x, pos_y)) {
|
|
printf("8m");
|
|
}
|
|
else if (inCircle(2, -2, pos_x, pos_y)) {
|
|
printf("7m");
|
|
}
|
|
else {
|
|
printf("0m");
|
|
}
|
|
return 0;
|
|
} |