Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ArrayList_
- {
- class ArrayList
- {
- string[] arr;
- public int Length;
- public ArrayList(int Size)
- {
- arr = new string[Size];
- Length = Size;
- }
- public string this[int index]
- {
- set{ arr[index] = value; }
- get{ return arr[index]; }
- }
- public void Add(string s, int n)
- {
- var List = new ArrayList(Size: n);
- for (int i = 0; i < List.Length; i++)
- {
- List[i] = s;
- Console.Write(List[i] + " ");
- }
- }
- }
- class Program
- {
- static void Main()
- {
- var List = new ArrayList(Size: 3);
- List.Add("ggg", 1);
- List.Add("gbg", 1);
- List.Add("ggd", 1);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement