修改例子

例中的find应该返回元素的index,所以其签名应该是 `int Find(T x)` 而不是`T Find(T x)`
This commit is contained in:
Andrew 2019-10-29 10:28:24 -04:00 committed by GitHub
parent 9c34df8899
commit 5723b1bf1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -600,7 +600,7 @@ class StackFloat
public:
void push(float v);
float pop();
float Find(float x)
int Find(float x)
{
for(int i = 0; i < size; ++i)
{
@ -634,7 +634,7 @@ class Stack
public:
void push(T v);
T pop();
T Find(T x)
int Find(T x)
{
for(int i = 0; i < size; ++i)
{