September 27, 2009

Crunch a mathematical problem with LINQ ;)

The problem: "A book has 352 pages. How many 4's were used to print all of the page numbers?"

Here is the answer in LINQ (actually I reposted the task from this page). But check out the comments - the original solution was wrong, and there are so many others.