?? 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 + -