Skip to content

Commit 32a309d

Browse files
authored
Merge pull request wuye9036#43 from YJieZhang/smallFix
small fix for stack example
2 parents 62e51ae + af4b3d0 commit 32a309d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ReadMe.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,11 @@ template <float a> class E {}; // ERROR: 别闹!早说过只能是整数类型
579579
class StackInt
580580
{
581581
public:
582-
void push(Int v);
583-
Int pop();
584-
Int Find(Int x)
582+
void push(int v);
583+
int pop();
584+
int Find(int x)
585585
{
586-
for(Int i = 1; i <= size; )
586+
for(int i = 0; i < size; ++i)
587587
{
588588
if(data[i] == x) { return i; }
589589
}
@@ -598,11 +598,11 @@ public:
598598
class StackFloat
599599
{
600600
public:
601-
void push(Float v);
602-
Float pop();
603-
Int Find(Float x)
601+
void push(float v);
602+
float pop();
603+
float Find(float x)
604604
{
605-
for(Int i = 1; i <= size; )
605+
for(int i = 0; i < size; ++i)
606606
{
607607
if(data[i] == x) { return i; }
608608
}
@@ -634,9 +634,9 @@ class Stack
634634
public:
635635
void push(T v);
636636
T pop();
637-
Int Find(T x)
637+
T Find(T x)
638638
{
639-
for(Int i = 0; i <= size; ++i)
639+
for(int i = 0; i < size; ++i)
640640
{
641641
if(data[i] == x) { return i; }
642642
}

0 commit comments

Comments
 (0)