Fundamentalen

SortOfNumbers

Mar 20th, 2014
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2.  
  3. class SortOfNumbers
  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 > b && a > c)
  15.         {
  16.             if (b > c)
  17.             {
  18.                 Console.WriteLine("{0} {1} {2}", a, b, c);
  19.             }
  20.             else
  21.             {
  22.                 Console.WriteLine("{0} {1} {2}", a, c, b);
  23.             }
  24.         }
  25.         else if (b > a && b > c)
  26.         {
  27.             if (a > c)
  28.             {
  29.                 Console.WriteLine("{0} {1} {2}", b, a, c);
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine("{0} {1} {2}", b, c, a);
  34.             }
  35.         }
  36.         else
  37.         {
  38.             if (a > b)
  39.             {
  40.                 Console.WriteLine("{0} {1} {2}", c, a, b);
  41.             }
  42.             else
  43.             {
  44.                 Console.WriteLine("{0} {1} {2}", c, b, a);
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment