📄 main.c
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h>int *stack;int top;void STACKinit(int n){ stack = malloc(n * sizeof(int)); top = 0;}void STACKdestory(){ free(stack); top = 0;}void push(int item){ stack[top++] = item;}int pop(){ return stack[--top];}int STACKempty(){ return top == 0;}int main(int argc, char *argv[]){ char *a = argv[1]; int i; int N = strlen(a); STACKinit(N); for(i = 0; i < N; i++) { if(a[i] == '+') push(pop() + pop()); if(a[i] == '*') push(pop() * pop()); if(a[i] >= '0' && a[i] <= '9') push(0); while(a[i]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -