Solved problem 6

C# console solution for problem 6