Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 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 valami
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Dictionary<int, string> nev = new Dictionary<int, string>();
  14. nev.Add(nev.Count + 1, "Anna");
  15. nev.Add(nev.Count + 1, "Pista");
  16. nev.Add(nev.Count + 1, "Derek");
  17. nev.Add(nev.Count + 1, "Józsi");
  18. nev.Add(nev.Count + 1, "Béla");
  19. foreach (KeyValuePair<int, string> kvp in nev)
  20.  
  21. {
  22. Console.WriteLine("Sorszám: {0}, Név: {1}", kvp.Key, kvp.Value);
  23. }
  24. Console.ReadKey();
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement