Skip to content

small fix for stack example #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,11 @@ template <float a> class E {}; // ERROR: 别闹!早说过只能是整数类型
class StackInt
{
public:
void push(Int v);
Int pop();
Int Find(Int x)
void push(int v);
int pop();
int Find(int x)
{
for(Int i = 1; i <= size; )
for(int i = 0; i < size; ++i)
{
if(data[i] == x) { return i; }
}
Expand All @@ -598,11 +598,11 @@ public:
class StackFloat
{
public:
void push(Float v);
Float pop();
Int Find(Float x)
void push(float v);
float pop();
float Find(float x)
{
for(Int i = 1; i <= size; )
for(int i = 0; i < size; ++i)
{
if(data[i] == x) { return i; }
}
Expand Down Expand Up @@ -634,9 +634,9 @@ class Stack
public:
void push(T v);
T pop();
Int Find(T x)
T Find(T x)
{
for(Int i = 0; i <= size; ++i)
for(int i = 0; i < size; ++i)
{
if(data[i] == x) { return i; }
}
Expand Down