Advertisement
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;
- using System.Threading.Tasks;
- namespace DictionariesDemo
- {
- class DictionariesDeemo
- {
- static void Main()
- {
- int[] arr = new int[] { 30, 40, 50 };
- for (int i = 0; i < arr.Length; i++)
- {
- Console.WriteLine("postion -> {0} - element -> {1}", i, arr[i]);
- }
- Console.WriteLine();
- Dictionary<int, int> nums = new Dictionary<int, int>();
- nums[0] = 30;
- nums[1] = 40;
- nums[2] = 50;
- foreach(var elements in nums)
- {
- Console.WriteLine("dict {0} - postion {1}",elements.Key,elements.Value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement