Advertisement
NedyalkoKikov

DictionaryDemo

Jun 7th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 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. Dictionary<int, int> nums = new Dictionary<int, int>();
  20. nums[0] = 30;
  21. nums[1] = 40;
  22. nums[2] = 50;
  23. foreach(var elements in nums)
  24. {
  25. Console.WriteLine("dict {0} - postion {1}",elements.Key,elements.Value);
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement