Advertisement
ognyan

Untitled

Feb 1st, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class Dictionary
  5. {
  6.     static void Main()
  7.     {
  8.         Dictionary<string, string> Dictionary = new Dictionary<string, string>()
  9.                     {
  10.                         { ".NET","  platform for applications from Microsoft"},
  11.                         {"CLR"," managed execution environment for .NET"},
  12.                         {"namespace","hierarchical organization of classes"}
  13.                     };
  14.         Console.Write("Please insert a word to translate (.NET,CLR,namespace): ");
  15.         string word = Console.ReadLine();
  16.  
  17.         foreach (KeyValuePair<string, string> pair in Dictionary)
  18.         {
  19.             if (word == pair.Key)
  20.             {
  21.                 Console.WriteLine("The meaning of the {0} is {1}", word, pair.Value);
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine("No meaning of the {0} found!", word);
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement