Simple exercise in C#