PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/Programing/C#/Exams/Simple Exame 2011/test/Problem 1 – Cartesian Coordinate System.cs

https://github.com/AssiNET/TelerikHomework
C# | 50 lines | 44 code | 6 blank | 0 comment | 22 complexity | a751f1a8ed99591c8a9a375fd0a581e3 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace test
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. decimal x = decimal.Parse(Console.ReadLine());
  13. decimal y = decimal.Parse(Console.ReadLine());
  14. if (x == 0 && y == 0)
  15. {
  16. Console.WriteLine(0);
  17. }
  18. else if (x > 0 && y > 0)
  19. {
  20. Console.WriteLine(1);
  21. }
  22. else if (x < 0 && y > 0)
  23. {
  24. Console.WriteLine(2);
  25. }
  26. else if (x < 0 && y < 0)
  27. {
  28. Console.WriteLine(3);
  29. }
  30. else if (x > 0 && y < 0)
  31. {
  32. Console.WriteLine(4);
  33. }
  34. else if (x == 0)
  35. {
  36. Console.WriteLine(5);
  37. }
  38. else if (y == 0)
  39. {
  40. Console.WriteLine(6);
  41. }
  42. }
  43. }
  44. }