Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. class Snowmen
  6. {
  7. static void Main()
  8. {
  9. int[] ints = { 1, 2, 3, 4 };
  10.  
  11. Dictionary<int, string> dict = new Dictionary<int, string>()
  12. {
  13. {3, "pesho" },
  14. {2, "stamata" },
  15. {1, "prakash" },
  16. {0, "polina" }
  17. };
  18.  
  19. foreach (var pair in dict.OrderBy(x => ints[x.Key]))
  20. {
  21. Console.WriteLine(pair.Value);
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement