Advertisement
Guest User

Coordinate System EXAM !!!!!!!!!!!!!!!!!!!!!

a guest
Oct 31st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CoordinateSystem
  4. {
  5. class CoordinateSystem
  6. {
  7. public static void Main(string[] args)
  8. {
  9. decimal x = decimal.Parse(Console.ReadLine());
  10. decimal y = decimal.Parse(Console.ReadLine());
  11. bool first = x > 0 && y > 0;
  12. bool second = x < 0 && y > 0;
  13. bool third = x < 0 && y < 0;
  14. bool fourth = x > 0 && y < 0;
  15. bool zero = x == 0 && y == 0;
  16. bool fifth = x == 0 && y > 0 || y < 0;
  17. bool sixth = y == 0 && x > 0 || x < 0;
  18. if(zero)
  19. {
  20. Console.WriteLine("0");
  21. }
  22. else if(second)
  23. {
  24. Console.WriteLine("2");
  25. }
  26. else if(third)
  27. {
  28. Console.WriteLine("3");
  29. }
  30. else if(fourth)
  31. {
  32. Console.WriteLine("4");
  33. }
  34. else if(fifth)
  35. {
  36. Console.WriteLine("5");
  37. }
  38. else if(sixth)
  39. {
  40. Console.WriteLine("6");
  41. }
  42. else if(first)
  43. {
  44. Console.WriteLine("1");
  45. }
  46.  
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement