using System; public class A { private double d, e, f; public A(double v){ d = e = f = v; } public double this [int i]{ get { switch (i){ case 1: {return d;} case 2: {return e;} case 3: {return f;} default: throw new Exception("Error"); } } set { switch (i){ case 1: {d = value; break;} case 2: {e = value; break;} case 3: {f = value; break;} default: throw new Exception("Error"); } } } public override string ToString(){ return "A: " + d + ", " + e + ", " + f; } }