Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. class SumCalc
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         string numbers = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10";
  6.     // :v
  7.         int sum = numbers.Split(' ').Select(n => int.Parse(n.Replace(",", ""))).ToArray().Sum();
  8.  
  9.         Console.WriteLine(sum);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement