Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace CSharpAdvanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = Console.ReadLine();
- Func<string, int> change = x => int.Parse(x);
- var numbers = input.Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries)
- .Select(change)
- .ToArray();
- Console.WriteLine(numbers.Length);
- Console.WriteLine(numbers.Sum());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement