[전자계산기] 계산기(C언어)
- 최초 등록일
- 2004.04.15
- 최종 저작일
- 2004.04
- 7페이지/ 한컴오피스
- 가격 1,000원
목차
없음
본문내용
/* The basic scientific calculator using stack */
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAX 128
#define NULL 0
#define UNDERFLOW -1
long stack[MAX]; // all characters are inputed.
float stack1[MAX]; // After grasping inputed characters, input floating numbers.
int top = -1;
/* Insert value n into stack, which operator is push */
int push(long n)
{
top++;
if (top > MAX) // check overflow of stack
{
printf("\nStack Overflow!\n");
exit(1);
}
stack[top]=n; // push on stack
return 1;
}
참고 자료
없음