summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--4/10.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/4/10.c b/4/10.c
new file mode 100644
index 0000000..baa6546
--- /dev/null
+++ b/4/10.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <string.h>
+
+#define MAXOP 100
+#define MAXLINE 1000
+
+#define NUM '0'
+#define FUN '1'
+#define ASG '2'
+#define VAR '3'
+
+int getop(char[]);
+void push(double);
+double peek();
+double pop();
+void clear();
+
+int main(int argc, char *argv[]) {
+ int type;
+ char s[MAXOP];
+
+ while (type == getop(s)) {
+ switch (type) {
+ case NUM:
+ break;
+ case '+':
+ break;
+ case '-':
+ break;
+ case '*':
+ break;
+ case '/':
+ break;
+ case '%':
+ break;
+ case FUN:
+ break;
+ case ASG:
+ break;
+ case VAR:
+ break;
+ default:
+ printf("error: unknown command %s\n", s);
+ }
+ }
+
+ return 0;
+} \ No newline at end of file