using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class intList
{
int[] M;
int count = 0;
int Capacity;
const int defaultCapacity = 10;
public intList (int a)
{
this.M = new int[a];
Capacity = a;
}
public void add(int a)
{
this.M[count] = a;
this.count++;
}
public void addrange(int[] a)
{
for (int i = 0; i < a.Length; i++)
{
this.M[count] = a[i];
count++;
}
}
public void clear()
{
for (int i = Capacity; i >= 0; i++)
{
this.M[i] = 0;
}
}
public bool Contains(int a)
{
bool b = false;
for (int i = 0; i < count; i++)
{
if (this.M[i] == a)
{
b = true;
}
}
return b;
}
public void CopyTo(intList a)
{
this.M = a.M;
this.count = a.count;
}
public System.Collections.IEnumerator GetEnumerator()
{
for (int i = 0; i < this.count; i++)
{
yield return M[i];
}
}
public static intList operator <<(intList a, int b)
{
intList qwe = new intList(a.count);
for (int i = 0; i < a.count - b; i++)
{
qwe.M[i] = a.M[i + b];
}
for (int i = a.count - b; i < a.count; i++)
{
qwe.M[i] = a.M[i + b - a.count];
}
return qwe;
}
public int this[int i]
{
get { return M[i]; }
set {M[i] = value;}
}
}
class Program
{
static void Main(string[] args)
{
intList IL = new intList(10);
IL.add(1);
IL.add(2);
IL.add(3);
IL.add(4);
IL.add(5);
IL.addrange(new int[] { 6, 7, 8, 9 });
for (int i = 0; i < 9; i++)
{
Console.Write(" {0}", IL[i]);
}
Console.WriteLine();
IL = IL << 7;
for (int i = 0; i < 9; i++)
{
Console.Write(" {0}", IL[i]);
}
Console.WriteLine();
}
}
}