using System;
using System.Collections;
using System.Collections.Generic;
namespace Csharp
{
class Program
{
//元组Tuple类型
public static Tuple<int, int> Divide(int dividend, int divisor)
{
int result = dividend / divisor;
int reminder = dividend % divisor;
return Tuple.Create<int, int>(result,reminder);
}
static void Main(string[] args)
{
var result = Divide(5,2);
Console.WriteLine("result of division: {0}, reminder: {1}",result.Item1,result.Item2);
Console.ReadKey();
}
}
}
C#的元组Tuple类型
最新推荐文章于 2024-07-11 13:48:49 发布