#include <cstdio>
#include <cstring>
#include <cassert>

template <class T>
struct array
{
  int n;
  T *a;

  array( int _n = 0 ) : n(_n)
  {
    assert(n >= 0);
    a = new T[n];
  }
  array( int _n, T value ) : n(_n)
  {
    assert(n >= 0);
    a = new T[n];
    for (int i = 0; i < n; i++)
      a[i] = value;
  }
  ~array()
  {
    if (a)
      delete [] a;
    a = 0;
  }

  T & operator [] ( int i )
  {
    assert(0 <= i && i < n);
    return a[i];
  }
};

int main()
{
  array <int> a(10);
  for (int i = 0; i < 11; i++)
  {
    a[i] = i;
    printf("%d\n", i); 
  }
  return 0;
}