Problem 16, C#