-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