최재영 알고 과제 2 스택을 사용하는 정수 계산기
- 최초 등록일
- 2019.05.17
- 최종 저작일
- 2018.09
- 21페이지/
한컴오피스
- 가격 3,000원
![할인쿠폰받기](/images/v4/document/ico_det_coupon.gif)
목차
1.헤더 및 소스코드
2.디버거 사용 흔적
3.실행결과
본문내용
#1 헤더 및 소스코드
//헤더파일
//Calculator.h
#ifndef CALCULATOR_H
#define CALCULATOR_H
#include <stdlib.h>
#include <math.h>
#include "LinkedListStack.h"
typedef enum
{
LEFT_PARENTHESIS = '(', RIGHT_PARENTHESIS = ')',
PLUS = '+', MINUS = '-',
MULTIPLY = '*', DIVIDE = '/',
POWER = '^', MOD = '%',
SPACE = ' ', OPERAND
}SYMBOL;
int IsNumber(char Cipher);
int IsCalculator(char Cipher);
int IsOperator(char Cipher);
unsigned int GetNextToken(char* Expression, char* Token, int* TYPE);
int IsPrior(char Operator1, char Operator2);
void GetPostfix(char* InfixExpression, char* PostfixExpression);
double Calculate(char* PostfixExpression);
char* RemoveSpace(char* Expression);
int CheckExpression(char* InfixExpression);
#endif
//LinkedListStack.h
#ifndef LINKEDLIST_STACK_H
#define LINKEDLIST_STACH_H
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct tagNode
{
char* Data;
struct tagNode* NextNode;
}Node;
typedef struct tagLinkedListStack
{
Node* List;
Node* Top;
}LinkedListStack;
참고 자료
없음