damyan91

Untitled

Jun 22nd, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. namespace ArrangeIntegers
  2. {
  3. using System;
  4. using System.Linq;
  5.  
  6. public class ArrangeIntegersMain
  7. {
  8. private static readonly string[] IntegerNames = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
  9.  
  10. public static void Main()
  11. {
  12. Console.WriteLine(string.Join(", ", Console.ReadLine()
  13. .Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)
  14. .OrderBy(str => string.Join(string.Empty, str.Select(ch => IntegerNames[ch - '0'])))));
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment