[C language project actual combat] C language implementation calculator

The case in this article uses C language to make a simple calculator to perform addition, subtraction, multiplication, and division operations. All the mathematical knowledge involved in this program is very simple, but the input process will increase the complexity. They are all very basic things in C language (input and output). After learning, you can write a complete C language program. It is suitable for the basic grammar of C language, and input and output. Suitable for beginners to learn.

Specific effect

Insert picture description here

#include "stdio.h"
#include "string.h"
#define LEN 99//计算式最大长度,可以自定义

/*
 *	1.C语言计算式(字符串形式)求解函数.
 *	2.支持符号:0~9 + - * / . ( ) 注:小括号可以是n级
 *  3.负数在计算式中需要这样表示,如:-6*5 >>>>>> (0-6)*5
 *  4.需要保持式子的正确性和完整性,不然程序有可能报错
 *  5.原理是用了三个栈,指针不断分析字符串里每个字符,
 *	  不断存进三个栈中,一个存数字的个位十位等每一位,一个存运算符,一

Guess you like

Origin blog.csdn.net/weixin_54707168/article/details/114985764