Problem 1 in c#