#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100
typedef struct //运算数
{
char a[MAX][MAX];
int top;
}OPND;
void Init_OPND(OPND *s) //初始化运算数栈
{
s->top =-1;
}
void Push_OPND(OPND *s,char x[20]) //push一个运算数
{
s->top++;
strcpy(&(s->a[s->top][MAX]),x);
}
void Push_OPTR(OPTR *s,char x) //push一个运算符
{
s->top ++;
s->a[s->top ]=x;
}
int func(int e)
{
int i = 0 ,result = 0;
for(i = 1; i <= e; i++)
{
result = result + i * 10;
}
return result;
}
i
#include <stdlib.h>
#include <string.h>
#define MAX 100
typedef struct //运算数
{
char a[MAX][MAX];
int top;
}OPND;
void Init_OPND(OPND *s) //初始化运算数栈
{
s->top =-1;
}
void Push_OPND(OPND *s,char x[20]) //push一个运算数
{
s->top++;
strcpy(&(s->a[s->top][MAX]),x);
}
void Push_OPTR(OPTR *s,char x) //push一个运算符
{
s->top ++;
s->a[s->top ]=x;
}
int func(int e)
{
int i = 0 ,result = 0;
for(i = 1; i <= e; i++)
{
result = result + i * 10;
}
return result;
}
i