文档介绍
用C语言写的计算器源代码.txt什么叫神话?请听男人向你表达爱意;什么叫传说?请听男人对你的承诺;什么叫梦境?请看你自己听到前两者时的反应。用C语言写的计算器源代码#include<stdio.h>#include<iostream.h>#include<stdlib.h>#include<string.h>#include<ctype.h>typedeffloatDataType;typedefstruct{DataType*data;intmax;inttop;}Stack;voidSetStack(Stack*S,intn){S->data=(DataType*)malloc(n*sizeof(DataType));if(S->data==NULL){printf("overflow");exit(1);}S->max=n;S->top=-1;}voidFreeStack(Stack*S){free(S->data);}intStackEmpty(Stack*S){if(S->top==-1)return(1);return(0);}DataTypePeek(Stack*S){if(S->top==S->max-1){printf("Stackisempty!\n");exit(1);}return(S->data[S->top]);}voidPush(Stack*S,DataTypeitem){if(S->top==S->max-1){printf("Stackisfull!\n");exit(1);}S->top++;S->data[S->top]=item