Venciity

[SoftUni C# exam preparation] 01.CoordinateSystem

Apr 9th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2.  
  3.     class CoordinateSystem
  4.     {
  5.         static void Main()
  6.         {
  7.             decimal X = Decimal.Parse(Console.ReadLine());
  8.             decimal Y = Decimal.Parse(Console.ReadLine());
  9.  
  10.             if (X == 0 && Y == 0)
  11.             {
  12.                 Console.WriteLine(0);
  13.             }
  14.             else if (X == 0)
  15.             {
  16.                 Console.WriteLine(5);
  17.             }
  18.             else if (Y == 0)
  19.             {
  20.                 Console.WriteLine(6);
  21.             }
  22.             else if (X > 0 && Y > 0)
  23.             {
  24.                 Console.WriteLine(1);
  25.             }
  26.             else if (X < 0 && Y > 0)
  27.             {
  28.                 Console.WriteLine(2);
  29.             }
  30.             else if (X < 0 && Y < 0)
  31.             {
  32.                 Console.WriteLine(3);
  33.             }
  34.             else // if (X > 0 && Y < 0)
  35.             {
  36.                 Console.WriteLine(4);
  37.             }
  38.         }
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment