NedyalkoKikov

SortedDictionaries

Jun 7th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DictionariesDemo
  8. {
  9. class DictionariesDeemo
  10. {
  11. static void Main()
  12. {
  13. int[] arr = new int[] { 30, 40, 50 };
  14. for (int i = 0; i < arr.Length; i++)
  15. {
  16. Console.WriteLine("postion -> {0} - element -> {1}", i, arr[i]);
  17. }
  18. Console.WriteLine();
  19. SortedDictionary<string, int> demos = new SortedDictionary<string, int>();
  20. demos["pesho"] = 30;
  21. demos["gosho"] = 40;
  22. demos["kiro"] = 500;
  23. demos["gosho"] = 2000;
  24. demos.Remove("gosho");
  25. if (demos.ContainsKey("kiro"))
  26. {
  27. Console.WriteLine(demos["kiro"]);
  28. }
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment