Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. int main()
  5. {
  6.     float A, B, C;
  7.     float x, y;
  8.  
  9.     A = -4;
  10.     B =  5;
  11.     C =  6;
  12.  
  13.     printf("Enter X Y -> ");
  14.     scanf("%f%f", &x, &y);
  15.  
  16.     if(x/A+y/B < 1 && x < 0 && y > 0) // находится ли точка в области B
  17.         printf("Your point in B zone");
  18.     else
  19.       if(x/A+y/B > 1 && x < 0 && y < 0) // находится ли точка в области A
  20.         printf("Your point in A zone");
  21.       else
  22.         if(x/C+y/B < 1 && x >0 && y < 0) // находится ли точка в области C
  23.             printf("Your point in C zone");
  24.         else
  25.             printf("Your point not in zone"); // точка не воходит ни в одну их обласлей
  26.  
  27.  
  28.     getch();
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement