using System;
namespace P5_15
{
    class IndexerClass
    {
        private int[] arr = new int[100];	
        public int this[int index]   		
        {
            get
            {
                if (index < 0 || index >= 100)
                {
                    return 0;
                }
                else
                {
                    return arr[index];
                }
            }
            set
            {
                if (!(index < 0 || index >= 100))
                {
                    arr[index] = value;
                }
            }
        }
    }
    class Program
    {
        static void Main()
        {
            IndexerClass test = new IndexerClass();
            test[3] = 256;
            test[5] = 1024;
            for (int i = 0; i <=7; i++)
            {
                System.Console.WriteLine("{0}Ԫصֵǣ{1}", i, test[i]);
            }
            Console.ReadLine();
        } 
     }
}
