desislava_topuzakova

11. TriFunction

Jun 3rd, 2022
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace TriFunction
  5. {
  6. class TriFunction
  7. {
  8. static void Main(string[] args)
  9. {
  10. int treshold = int.Parse(Console.ReadLine());
  11. string[] names = Console.ReadLine().Split(" ");
  12. Console.WriteLine(names.First(name => name .Select(symbol => (int)symbol ).Sum() >= treshold));
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment