Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace CustomMinFunction
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] numbers = Console.ReadLine().Split().Select(int.Parse).ToArray();
- Func<int[], int> funcMinNumber = nums =>
- {
- int minValue = int.MaxValue;
- foreach (var num in numbers)
- {
- if (num < minValue)
- {
- minValue = num;
- }
- }
- return minValue;
- };
- Console.WriteLine(funcMinNumber(numbers));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement