Tags:. SH floating-point separators should calculate bar integer ACE SpecialUse Shell to write a simple calculator, you can implement add, subtract, multiply, divide operation, if the script name is 1.sh, execute example:./1.sh 1 + 2#!/bin/bashif[$#-ne3]thenecho "The number of parameters should be 3, for example: $01 +2 "echo" when using multiplication, you need to add the caret, for example: $01\*2 "exit 1

/** * Seek the powers of a number * x^y,y is a positive integer.The calculator can only calculate two number multiplication, cannot calculate n number multiplication at one time.* Know: 2^5= (2^2) ^2*2; 2^6= (2^2) ^3= ((4) ^2); 2^8= (2^2) ^4= (4^2) ^2= 16^2 * Get the rule: x^y= (x^2) ^ (Y/2), define A=X^2,B=Y/2, then get shape such as: x^y= a^b; * y assumes an odd number, then the decomposition of the last multiplied by a (as above 2^6 decompos

The calculator with parentheses is also the first self-feeling to finish the best after all really got one weeks although the early stage of the road is really hard to go I will try to refuel Python learn practicalRefer to two bloggers ' articlesHttp://www.cnblogs.com/0zcl/p/5983236.htmlhttp://www.cnblogs.com/loyfee/p/5764926.html#3538071The general process is to first convert the input data into a list to

/*
Name: scientific calculator (four arithmetic operations of floating-point numbers with parentheses can be implemented)
Copyright:
Author:
Date: 15-09-14
Description: reads a computing expression from a file, converts the computing expression to an inverse polish expression, computes the value of the inverse polish expression, and finally outputs the answer.
*/
# Include # Include # Include # Include

Calculator with parentheses
// This calculator supports the brackets function. The format Example 3 + (3*3) # is followed by two # The calculation is complete, and features such as factorial and power are left to the students for improvement.# Include

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.