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;
- namespace _05SortStringArray
- {
- class SortStringArray
- {
- static void Main(string[] args)
- {
- List<string> input = new List<string>();
- while (input.Count < 5)
- {
- input.Add(Console.ReadLine());
- }
- var result = from elem in input
- orderby elem.Length ascending
- select elem;
- Console.WriteLine(new String('-', 30));
- foreach (var item in result)
- {
- Console.WriteLine(item);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment