Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main(int argc, char** argv) {
  4. float x, y;
  5. printf ("Input x:");
  6. scanf ("%f", &x);
  7. printf ("Input y:");
  8. scanf ("%f", &y);
  9. if (y <=1 && y >= -x/2 && y >= (x+1)/2) {
  10. printf ("True");
  11. }
  12. else if ( y>= -1 && y <=x/2 && y<= (-x-1)/2) {
  13. printf ("True");
  14. }
  15. else if (y <=1 && y >= (-x+1)/2 && y >= x/2) {
  16. printf ("True");
  17. }
  18. else if (y >=1 && y <= -x/2 && y <= (x-1)/2) {
  19. printf ("True");
  20. }
  21. else if (y >=0 && y <= -x/2 && y <= (x+1)/2) {
  22. printf ("True");
  23. }
  24. else if (y >=0 && y <= x/2 && y <= (-x+1)/2) {
  25. printf ("True");
  26. }
  27. else if (y <=0 && y >= (-x-1)/2 && y >= x/2) {
  28. printf ("True");
  29. }
  30. else if (y <=0 && y >= -x/2 && y >= (x-1)/2) {
  31. printf ("True");
  32. }
  33. else {
  34. printf ("False");
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement