Advertisement
stoianpp

dictionary

Dec 31st, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 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. //A dictionary is stored as a sequence of text lines containing words and their explanations.
  8. //Write a program that enters a word and translates it by using the dictionary. Sample dictionary:
  9. //.NET – platform for applications from Microsoft
  10. //CLR – managed execution environment for .NET
  11. //namespace – hierarchical organization of classes
  12.  
  13. class Dictionary
  14. {
  15.     static void Main()
  16.     {
  17.         Dictionary<string,string> dic = new Dictionary<string,string>();
  18.         dic.Add(".NET", "platform for applications from Microsoft");
  19.         dic.Add("CLR", "managed execution environment for .NET");
  20.         dic.Add("namespace", "hierarchical organization of classes");
  21.         Console.WriteLine("Enter one of the words - .NET, CLR, namespace: ");
  22.         string input = Console.ReadLine();
  23.         Console.WriteLine("{0} - {1}",input,dic[input]);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement