lmarkov

Cartesian Coordinate System

Dec 14th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 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 CartesianCoordinateSystem
  8. {
  9.     class CartesianCoordinateSystem
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             decimal coordinateX = decimal.Parse(Console.ReadLine());
  14.             decimal coordinateY = decimal.Parse(Console.ReadLine());
  15.  
  16.             if (coordinateX == 0 && coordinateY == 0)
  17.             {
  18.                 Console.WriteLine(0);
  19.             }
  20.             else if (coordinateX > 0 && coordinateY > 0)
  21.             {
  22.                 Console.WriteLine(1);
  23.             }
  24.             else if (coordinateX < 0 && coordinateY > 0)
  25.             {
  26.                 Console.WriteLine(2);
  27.             }
  28.             else if (coordinateX < 0 && coordinateY < 0)
  29.             {
  30.                 Console.WriteLine(3);
  31.             }
  32.             else if (coordinateX > 0 && coordinateY < 0)
  33.             {
  34.                 Console.WriteLine(4);
  35.             }
  36.             else if (coordinateX == 0 && coordinateY != 0)
  37.             {
  38.                 Console.WriteLine(5);
  39.             }
  40.             else if (coordinateX != 0 && coordinateY == 0)
  41.             {
  42.                 Console.WriteLine(6);
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment