Giter VIP home page Giter VIP logo

calculate's Introduction

calculate

C++作业:基于栈堆的简单计算器

【问题描述】

链栈是一种采用链式结点(node)结构实现栈(stack)后进先出(LIFO),只能在顶部结点进行操作的数据结构。基于链栈结构实现一个简单计算器的功能。

【要求】

  1. 支持加、减、乘、除、求余、括号、次幂等基本操作。

  2. 扩展计算器功能,使其支持 sin、cos、tan、sqrt 等功能。

  3. 基于设计的计算器,计算以下表达式,其中 pi 的值可以通过 std::atan(1.0)*4 获得:

(1) 3-2*4+(6-1)/2+5

(2) sin(pi/6)+ cos(sqrt(2)) ^ tan(pi/3)

【提示】

  1. 基本四则运算书本已经介绍。

  2. 函数功能的实现可以考虑将运算符设为 string 类型压入运算符栈。

  3. 函数实现关键是如何准确读取 string 类型的函数名,如“sin”,而不是“si”或“s”,这样才能确保得到所要的函数。

calculate's People

Contributors

ming45 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.