表达式计算
- 用vector<string> 来模拟大数(长度超过int 型整数长度)的存取和运算,初步实现了加法、减法、乘法、除法运算。
- 其中,乘法是基于循环加发实现的,除法是基于循环减法实现的。
- 表达式中可以嵌套多层括号,通过二叉树来实现运算符优先级的选取。
个人感觉用string来模拟大数运算效率有点低,但是string内的char 型只有一个字节,占用较小 的存取空间。
表达式计算
个人感觉用string来模拟大数运算效率有点低,但是string内的char 型只有一个字节,占用较小 的存取空间。