Advertisement
Guest User

Exam04

a guest
Mar 19th, 2014
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ex04
  4. {
  5.     class Exam04
  6.     {
  7.         static void Main()
  8.         {
  9.             double a = double.Parse(Console.ReadLine());
  10.             double b = double.Parse(Console.ReadLine());
  11.             double c = double.Parse(Console.ReadLine());
  12.             if (a==0||b==0||c==0)
  13.             {
  14.                 Console.WriteLine("0");
  15.             }
  16.             else
  17.             if(a>0) {
  18.                 if (b > 0 && c > 0) Console.WriteLine("+");
  19.                 else if (b < 0 && c < 0) Console.WriteLine("+");
  20.                 else Console.WriteLine("-");
  21.                 }
  22.             else
  23.             {
  24.                 if (b > 0 && c > 0) Console.WriteLine("-");
  25.                 else if (b < 0 && c < 0) Console.WriteLine("-");
  26.                 else Console.WriteLine("+");
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement