📄 stack.cpp
字号:
// stack.cpp: implementation of the stack class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "L1.h"
#include "stack.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
stack::stack()
{
st[0]='#';
st[1]='E';
st[2]='\0';
top=2;
}
stack::~stack()
{
}
void stack::pop(){
top--;
st[top]='\0';
}
void stack::push(char *ch){
int len, i;
len=strlen(ch);
for(i=len-1; i>=0; i--){
st[top]=ch[i];
top++;
}
st[top]='\0';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -