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 _5.Ascending
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("a = ");
- int a = Int32.Parse(Console.ReadLine());
- Console.Write("b = ");
- int b = Int32.Parse(Console.ReadLine());
- Console.Write("c = ");
- int c = Int32.Parse(Console.ReadLine());
- if (a > b) // b a
- {
- if (c < b) // c b a
- Console.WriteLine("{0} {1} {2}", c, b, a);
- else if (c > a) // b a c
- Console.WriteLine("{0} {1} {2}", b, a, c);
- else // b c a ( c>= b && c <= a )
- Console.WriteLine("{0} {1} {2}", b, c, a);
- }
- else // a b (a <= b )
- {
- if (c < a) // c a b
- Console.WriteLine("{0} {1} {2}", c, a, b);
- else if (c > b) // a b c
- Console.WriteLine("{0} {1} {2}", a, b, c);
- else // a c b
- Console.WriteLine("{0} {1} {2}", a, c, b);
- }
- //if (a <= b && b <= c) //a b c
- // Console.WriteLine("{0} {1} {2}", a, b, c);
- //else if (a <= c && c <= b) // a c b
- // Console.WriteLine("{0} {1} {2}", a, c, b);
- //else if (b <= a && a <= c) // b a c
- // Console.WriteLine("{0} {1} {2}", b, a, c);
- //else if (b <= c && c <= a) // b c a
- // Console.WriteLine("{0} {1} {2}", b, c, a);
- //else if (c <= a && a <= b) // c a b
- // Console.WriteLine("{0} {1} {2}", c, a, b);
- //else if (c <= b && b <= a) // c b a
- // Console.WriteLine("{0} {1} {2}", c, b, a);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment