CLearn/C_Design_Practice/4_12_tower_map.c

14 lines
298 B
C

#include <stdio.h>
int main(void)
{
double x,y;
int height=0;
printf("Please input map coordinate x y :\n");
scanf("%lf%lf",&x,&y);
if (x<0) x=-x;
if (y<0) y=-y;
printf("Height = ");
if ((x*x+y*y-4*x-4*y+8)<=1) height = 10;
printf("%dm.",height);
return 0;
}