Coder Social home page Coder Social logo

mycalc's Introduction

mycalc

一个计算器,支持加减乘除四则运算。

简单的记录一下造轮子的过程

安装

首先拷贝仓库

git clone https://github.com/ChordXD/mycalc.git

Windows

  1. 确保gcc编译器已经正确安装
  2. 确保已经安装bison与flex.
  3. 依次在下载的仓库中执行
bison --yacc -dv mycalc.y
flex mycalc.l
gcc -o mycalc y.tab.c lex.yy.c
  1. 最后启动可执行文件mycalc即可。

Linux

  1. 确保gcc环境正确配置。
  2. 依次在下载的仓库中执行:
sudo apt-get install flex bison
bison --yacc -dv mycalc.y
flex mycalc.l
cc -o mycalc y.tab.c lex.yy.c
  1. ./mycalc即可运行

使用方法

  • 支持四则运算即 +、-、×、\ 四种运算符的混合运算。
  • 请在一行之内输入表达式。
  • 精度在double范围之内
  • 除了数字与上述四中运算符以外,其他的均为非法字符。
  • 不支持非法表达式。

mycalc's People

Contributors

chordxd 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.