Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Sort3NumbersWithNestedIfs
- {
- class Sort3NumbersWithNestedIfs
- {
- static void Main(string[] args)
- {
- double a = double.Parse(Console.ReadLine());
- double b = double.Parse(Console.ReadLine());
- double c = double.Parse(Console.ReadLine());
- if (a>=b && a>c)
- {
- if (b>=c)
- {
- Console.WriteLine("{0} {1} {2}", a, b, c);
- }
- else
- {
- Console.WriteLine("{0} {1} {2}", a, c, b);
- }
- }
- if (b>a && b>=c)
- {
- if (a>=c)
- {
- Console.WriteLine("{0} {1} {2}", b, a, c);
- }
- else
- {
- Console.WriteLine("{0} {1} {2}", b, c, a);
- }
- }
- if (c >= a && c > b)
- {
- if (a >= b)
- {
- Console.WriteLine("{0} {1} {2}", c, a, b);
- }
- else
- {
- Console.WriteLine("{0} {1} {2}", c, b, a);
- }
- }
- if (a==b && a==c)
- {
- Console.WriteLine("{0} {1} {2}", c, b, a);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement