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)
- {
- int number = int.Parse(Console.ReadLine());
- var names = Console.ReadLine().Split().ToList();
- Console.WriteLine(names.FirstOrDefault(name => name.ToCharArray().Sum(x => x) >= number));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement