Advertisement
gabi11

Functional Programming - 13. TriFunction

Jun 1st, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6.  
  7.  
  8. namespace CSharpAdvanced
  9. {
  10.  
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             int number = int.Parse(Console.ReadLine());
  16.  
  17.             var names = Console.ReadLine().Split().ToList();
  18.  
  19.             Console.WriteLine(names.FirstOrDefault(name => name.ToCharArray().Sum(x => x) >= number));
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement