Advertisement
YavorJS

Point_in_the_figure

Jun 3rd, 2016
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Point_in_the_figure
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int x = int.Parse(Console.ReadLine());
  14. int y = int.Parse(Console.ReadLine());
  15. bool fig1 = false;
  16. bool fig2 = false;
  17. bool fig3 = false;
  18. //Top figure
  19. if (x >= 4 && x<=10 && y <= -3 && y >= -5)
  20. {
  21. fig1 = true;
  22. }
  23. //Middle figure
  24. if (x >= 1 && x <= 12 && y <= 1 && y >= -3)
  25. {
  26. fig2 = true;
  27. }
  28. //Bottom figure
  29. if (x >= 4 && x <= 10 && y <= 3 && y >= 1)
  30. {
  31. fig3 = true;
  32. }
  33.  
  34. if(fig1||fig2||fig3 )
  35. {
  36. Console.WriteLine("in");
  37. }
  38. else
  39. {
  40. Console.WriteLine("out");
  41. }
  42.  
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement