https://stackoverflow.com/questions/166089/what-is-c-sharp-analog-of-c-stdpair
public class Pair<T, U> {
public Pair() {
}
public Pair(T first, U second) {
this.First = first;
this.Second = second;
}
public T First { get; set; }
public U Second { get; set; }
};
예제
Pair<String, int> pair = new Pair<String, int>("test", 2);
Console.WriteLine(pair.First);
Console.WriteLine(pair.Second);
test 2
Pair<Pair<String, int>, bool> pair = new Pair<Pair<String, int>, bool>(); pair.First = new Pair<String, int>(); pair.First.First = "test"; pair.First.Second = 12; pair.Second = true; Console.WriteLine(pair.First.First); Console.WriteLine(pair.First.Second); Console.WriteLine(pair.Second);
test 12 true


![백준 7562번 (나이트의 이동, C++) [BAEKJOON]](https://lycos7560.com/wp-content/uploads/boj-og.png)