Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class A{
- public string [] tab=new string [];
- public string this [int x]{
- get {return tab[i];}
- set {tab[x]=value;}
- }
- public int this [string a]
- {
- get
- {Console.WriteLine("x",+tab.Length);
- for (i=0;int<100;i++)
- if(tab[i])==a)
- return i;
- }
- }
- }
- {
- class Program
- {
- static void Main(string[] args)
- {
- A a=new A();
- a tab[0] = "Ala";
- a tab[1] = "Tak";
- a tab[2] = "Rak";
- a tab[3] = "Tok";
- a tab[4] = "Kot";
- a tab[5] = "Ala";
- a tab[6] = "Nie";
- a tab[7] = "Ala";
- a tab[8] = "tyk";
- a tab[9] = "pyk";
- a [10] = "Jan";
- for (int=0;int<11;i++)
- Console.WriteLine(a[i]);
- Console.WriteLine(a["Jan"]);
- Console.WriteLine(a["abc"]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement