Advertisement
Guest User

d

a guest
Nov 25th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. class A{
  4. public string [] tab=new string [];
  5.  
  6. public string this [int x]{
  7. get {return tab[i];}
  8. set {tab[x]=value;}
  9. }
  10. public int this [string a]
  11. {
  12. get
  13. {Console.WriteLine("x",+tab.Length);
  14. for (i=0;int<100;i++)
  15. if(tab[i])==a)
  16. return i;
  17. }
  18. }
  19. }
  20. {
  21. class Program
  22. {
  23. static void Main(string[] args)
  24. {
  25. A a=new A();
  26. a tab[0] = "Ala";
  27. a tab[1] = "Tak";
  28. a tab[2] = "Rak";
  29. a tab[3] = "Tok";
  30. a tab[4] = "Kot";
  31. a tab[5] = "Ala";
  32. a tab[6] = "Nie";
  33. a tab[7] = "Ala";
  34. a tab[8] = "tyk";
  35. a tab[9] = "pyk";
  36. a [10] = "Jan";
  37. for (int=0;int<11;i++)
  38. Console.WriteLine(a[i]);
  39. Console.WriteLine(a["Jan"]);
  40. Console.WriteLine(a["abc"]);
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement