Thursday, October 31, 2013

Project Euler. Problem 13. Large Sum Solution in C#

What a lovely pretty solution.


   BigInteger sum=0; 
   foreach(var line in File.ReadAllLines("data"))
    sum+=(BigInteger.Parse(line));
   Console.WriteLine(sum.ToString().Substring(0,10));



No comments:

Post a Comment