if(x > 0)
{
if(y > 0)
printf("Northeast.\n");
else if(y < 0)
printf("Southeast.\n");
else printf("East.\n");
}
else if(x < 0)
{
if(y > 0)
printf("Northwest.\n");
else if(y < 0)
printf("Southwest.\n");
else printf("West.\n");
}
else {
if(y > 0)
printf("North.\n");
else if(y < 0)
printf("South.\n");
else printf("Nowhere.\n");
}
No comments:
Post a Comment