fork download
  1. using System;
  2.  
  3. class Program
  4. {
  5. private static bool SortInc2(ref double a, ref double b)
  6. {
  7. if (a > b)
  8. {
  9. double t = a;
  10. a = b;
  11. b = t;
  12. return true;
  13. }
  14. return false;
  15. }
  16.  
  17. private static void SortInc3(ref double a, ref double b, ref double c)
  18. {
  19. while (SortInc2(ref a, ref b) || SortInc2(ref b, ref c))
  20. ;
  21. }
  22.  
  23. public static void Main()
  24. {
  25. double a, b, c;
  26. for (int i = 0; i < 2; ++i)
  27. {
  28. a = Double.Parse(Console.ReadLine());
  29. b = Double.Parse(Console.ReadLine());
  30. c = Double.Parse(Console.ReadLine());
  31. SortInc3(ref a, ref b, ref c);
  32. Console.WriteLine(a);
  33. Console.WriteLine(b);
  34. Console.WriteLine(c);
  35. }
  36. }
  37. }
Success #stdin #stdout 0.03s 24920KB
stdin
2.236067977
1.414213562
1.732050808
3.141592654
2.718281828
1.618033989
stdout
1.414213562
1.732050808
2.236067977
1.618033989
2.718281828
3.141592654