Advertisement
Guest User

sortNumbers

a guest
Oct 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Sort3Numbers
  4. {
  5.     class Sort3Numbers
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int a = int.Parse(Console.ReadLine());
  10.             int b = int.Parse(Console.ReadLine());
  11.             int c = int.Parse(Console.ReadLine());
  12.  
  13.  
  14.             if (a > b)
  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)
  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 if (c > a)
  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.      }
  49.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement