Advertisement
Tolyamba

2

Jan 24th, 2017
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. class MyCollection : Dictionary<int, Pair>
  2.     {
  3.         public void Print()
  4.         {
  5.             foreach (var i in Keys)
  6.                 Console.WriteLine("Key = {0}, value = {1}", i, this[i]);
  7.         }
  8.  
  9.         public void Add(int key, Pair valuee)
  10.         {            
  11.             base.Add(key, valuee);
  12.         }
  13.     }
  14.  
  15.  
  16. class Program
  17.     {
  18.         static void Main(string[] args)
  19.         {
  20.             Pair p = new Pair(1, 2);            
  21.             MyCollection mc = new MyCollection();
  22.             mc.Add(10, p);
  23.             mc.Print();  
  24.         }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement