小编Jac*_*man的帖子

c#7元组.无法在mac dotnet核心1.1中使用元组

我正在尝试在macOS中实现Visual Studio Code中的元组c#7新功能.

   using System;
   using System.Collections.Generic;

   namespace newcsharp
   {
    public class Program
    {
        public static void Main(string[] args)
        {
            int[] numbers = { 1, 3, 4, 10, 6, 20, 78, 15, 6 };
            var result = Range(numbers);
            Console.ReadLine();
        }

        private static (int Max, int Min) Range(IEnumerable<int> numbers)
        {
            int min = int.MaxValue;
            int max = int.MinValue;
            foreach (var n in numbers)
            {
                min = (n < min) ? n : min;
                max = (n > max) ? n : …
Run Code Online (Sandbox Code Playgroud)

c# .net-core visual-studio-code c#-7.0

7
推荐指数
1
解决办法
1259
查看次数

标签 统计

.net-core ×1

c# ×1

c#-7.0 ×1

visual-studio-code ×1