c# Dictionary拓展2个key得到1个value

Posted code1992

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c# Dictionary拓展2个key得到1个value相关的知识,希望对你有一定的参考价值。

using System.Collections.Generic;
using System.Collections;
Dictionary<Tuple<int, int>, int> dic = new Dictionary<Tuple<int, int>, int>();
dic.Add(new Tuple<int, int>(1, 2), 100);
dic.Add(new Tuple<int, int>(1, 3), 200);
dic.Add(new Tuple<int, int>(2, 1), 300);
int result = dic[new Tuple<int, int>(1, 3)];   //200

 

以上是关于c# Dictionary拓展2个key得到1个value的主要内容,如果未能解决你的问题,请参考以下文章