-4
我试图用C++编译这个函数没有成功。java stack - pop
这是一个java代码。主要是打电话给'测试'。我只是想知道,如果S堆发送的所有或S是部分发送(不含7),因为s.pop()
bool test(stack<int> s, int x) {
int y;
if (!s.empty()) {
y = s.pop();
return x==y || test(s,y);
}
else return false;
}
int main()
{
stack<int> s;
s.push(2);
s.push(5);
s.push(1);
s.push(2);
s.push(7);
int x = 4;
test(s, s.pop());
return (0);
}
Java在这整个事情在哪里? – amphibient 2013-02-19 22:12:26
当然,如果你回头看这个问题,你会意识到这是不可能理解的。 – 2013-02-19 22:12:27
显示汇编错误 – noMAD 2013-02-19 22:13:17