import java.util.Arrays; import java.util.EmptyStackException; public class MyStack<T> { private T[] elements; private int size = 0; private static final int INIT_CAPACITY = 16; public MyStack() { elements = (T[]) new Object[INIT_CAPACITY]; } public…
#include <iostream> #include <functional> using namespace std; auto Pair = [](auto u, auto v) { return [=](auto f) { return f(u, v); }; }; //auto First = todo; //auto Second = todo; auto First = [](auto p){ //p就是对应于t return p([](auto u, auto v…