Fundamentalen

MultiplicationSign

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