iliya87

CartesianCoordinateSystem

Mar 23rd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. class CartesianCoordinateSystem
  3. {
  4.     static void Main()
  5.     {
  6.         decimal x = decimal.Parse(Console.ReadLine());
  7.         decimal y = decimal.Parse(Console.ReadLine());
  8.         if (x == 0 && y == 0)
  9.         {
  10.             Console.WriteLine("0");
  11.         }
  12.         else if (x == 0 && y != 0)
  13.         {
  14.             Console.WriteLine("5");
  15.         }
  16.         else if (x != 0 && y == 0)
  17.         {
  18.             Console.WriteLine("6");
  19.         }
  20.         else if (x > 0 && y > 0)
  21.         {
  22.             Console.WriteLine("1");
  23.         }
  24.         else if (x > 0 && y < 0)
  25.         {
  26.             Console.WriteLine("4");
  27.         }
  28.         else if (x < 0 && y > 0)
  29.         {
  30.             Console.WriteLine("2");
  31.         }
  32.         else
  33.             Console.WriteLine("3");
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment