标签:元组 c# tuple元组 tuple
.NET 4定义了8个Tuple类,和一个静态Tuple类
---------------------------------------------------------------------返回多个值
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { Console.WriteLine("{0}*{1}={2}",Divide(1, 2).Item1, Divide(1, 2).Item2, Divide(1, 2).Item3);//1*2=2 Console.ReadKey(); } public static Tuple<int, int,int> Divide(int i, int j)// { return Tuple.Create<int, int, int>(i, j, i * j);//返回三个值 } } }
本文出自 “程序猿的家” 博客,请务必保留此出处http://962410314.blog.51cto.com/7563109/1531047
.NET 4新特性--Tuple元组,布布扣,bubuko.com
标签:元组 c# tuple元组 tuple
原文地址:http://962410314.blog.51cto.com/7563109/1531047