📄 1.cpp
字号:
#include<stdio.h>
#include<stidlib.h>
typedef Struct
{
int *base;
int *top;
int stacksize;
}SqStack;
void initstack(SqStack *S)
{
S->base=(int*)malloc(100*sizeof(int));
S->top=S->base;
S->Stacksize=100;
}
void push(SqStack *S,int e)
{
*S->top++=e;
}
int Pop(SqStack *S,int e)
{
*S->top++=e;
}
int Pop(SqStack *S,int *e)
{
*e=*--S--top;
reture(*e);
}
void main()
{
SqStack S;
int N,e;
Initstack(&S);
printf("please input a number:");
scanf("%d",&N);
while(N)
{
push(&S,N%8);
N=N/8;
}
while(S.base!=S.top)
{
Pop(&S,&e);
printf("%d\n",e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -