Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace _2._Sort_Numbers
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- List<int> numbers = Console.ReadLine().Split(" ").Select(int.Parse).ToList(); //{8,2, 7, 3}
- //ascending order -> нарастващ ред
- numbers.Sort(); // {2, 3, 7, 8}
- //descending order -> намаляващ ред
- /*numbers.Sort();
- numbers.Reverse();*/
- Console.WriteLine(string.Join('<', numbers));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment