BorislavBorisov

28.02.Cartesian Coordinate System

Nov 6th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 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.         FindQuadrants(X, Y);
  9.     }
  10.  
  11.     static void FindQuadrants(decimal X, decimal Y)
  12.     {
  13.         if(X == 0 && Y == 0)
  14.         {
  15.             Console.WriteLine(0);
  16.         }
  17.         else if(X > 0 && Y > 0)
  18.         {
  19.             Console.WriteLine(1);
  20.         }
  21.         else if(X == 0)//ако X е нула Y няма значение колко е
  22.         {
  23.             Console.WriteLine(5);
  24.         }
  25.         else if(Y == 0)
  26.         {
  27.             Console.WriteLine(6);
  28.         }
  29.         else if(X < 0 && Y > 0)
  30.         {
  31.             Console.WriteLine(2);
  32.         }
  33.         else if(X < 0 && Y < 0)
  34.         {
  35.             Console.WriteLine(3);
  36.         }
  37.         else if(X > 0 && Y < 0)
  38.         {
  39.             Console.WriteLine(4);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment