Advertisement
Guest User

SortThreeNumbers

a guest
Mar 22nd, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1.             float a = float.Parse(Console.ReadLine());
  2.             float b = float.Parse(Console.ReadLine());
  3.             float c = float.Parse(Console.ReadLine());
  4.             float temp;
  5.             if (a < b)
  6.             {
  7.                 temp = a;
  8.                 a = b;
  9.                 b = temp;    
  10.             }
  11.             if (a < c)
  12.             {
  13.                 temp = a;
  14.                 a = c;
  15.                 c = temp;
  16.             }
  17.             if (b < c)
  18.             {
  19.                 temp = b;
  20.                 b = c;
  21.                 c = temp;
  22.             }
  23.             Console.WriteLine("{0} {1} {2}", a, b, c);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement