mirror of
https://github.com/ada-dmitry/prog.l_ada.git
synced 2026-09-24 09:10:14 +00:00
add calkBT
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <error.h>
|
||||
#include "head.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char s[SIZE];
|
||||
Tree *tree = NULL;
|
||||
if (argc < 2)
|
||||
{
|
||||
printf("no expression\n");
|
||||
return 2;
|
||||
}
|
||||
strcpy(s, argv[1]);
|
||||
printf("processing %s\n", s);
|
||||
tree = maketree(s, 0, strlen(s) - 1);
|
||||
|
||||
printf("\n tree: \n");
|
||||
showtree(tree, 0);
|
||||
|
||||
printf("= %d \n", calculate(tree));
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user