数学英文表达!拜托咯!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数学英文表达!拜托咯!相关的知识,希望对你有一定的参考价值。

比如说3的4次方怎么说?
比如5的3次方分之3的5次方?
比如说开根号可以回答是square root of n。
数字可以用字母代替。
还有二次函数阿,反函数,正比例函数,之类的要怎么表达。
初中到高中的都可以!越多越好喔!

3 to the fourth

数学 mathematics,maths
公理 axiom
定理 theorem
计算 calculation
运算 operation
证明 prove
假设 hypothesis, hypotheses(pl.)
命题 proposition

定理 theorem

定义 defination
算术 arithmetic

数字 digit
数 number
自然数 natural number
整数 integer
小数 decimal
小数点 decimal point
分数 fraction
分子 numerator

分母 denominator
加 plus(prep.), add(v.), addition(n.)
被加数 augend, summand
加数 addend
和 sum
减 minus(prep.), subtract(v.), subtraction(n.)
被减数 minuend
减数 subtrahend
差 remainder, difference
乘 times(prep.), multiply(v.), multiplication(n.)
被乘数 multiplicand, faciend
乘数 multiplicator
积 product
除 divided by(prep.), divide(v.), division(n.)
被除数 dividend
除数 divisor
商 quotient
等于 equals, is equal to
大于 greater than
小于 less than
大于等于 equal or greater than
小于等于 equal or less than
运算符 operator
比 ratio
正 positive
负 negative
零 null, zero, nought, nil
十进制 decimal system
二进制 binary system
十六进制 hexadecimal system
权 weight, significance
进位 carry
截尾 truncation
四舍五入 round
下舍入 round down
上舍入 round up
有效数字 significant figure
代数 algebra
公式 formula, formulae(pl.)
单项式 monomial
多项式 polynomial, multinomial
系数 coefficient
未知数 unknown
等式,方程式 equation
一次方程 linear equation
二次方程 quadratic equation
三次方程 cubic equation
四次方程 quartic equation
不等式 inequality
阶乘 factorial
对数 logarithm
指数,幂 exponent
乘方 power
二次方,平方 square
三次方,立方 cube
四次方 the power of four, the fourth power
n次方 the power of n, the nth power
开方 evolution, extraction
二次方根,平方根 square root
三次方根,立方根 cube root
四次方根 the root of four, the fourth root
n次方根 the root of n, the nth root
集合 set
元素 element
空集 empty set
子集 subset
交集 intersection
并集 union
补集 complement
映射 mapping
函数 function
定义域 domain
值域 range
常量 constant
变量 variable
单调性 monotonicity
奇偶性 parity
周期性 periodicity
图象 image
数列,级数 series, sequence
微积分 calculus
微分 differentiation
导数 derivative
极限 limit
无穷 infinite(a.) infinity(n.)
积分 integral
定积分 definite integral
不定积分 indefinite integral
有理数 rational number
无理数 irrational number
实数 real number
虚数 imaginary number
复数 complex number
矩阵 matrix
行列式 determinant
几何 geometry
点 point
线 line
面 plane
体 solid
线段 segment
射线 radial
平行 parallel
相交 intersect
角 angle
角度 degree
弧度 radian
锐角 acute angle

直角 right angle
钝角 obtuse angle
平角 straight angle
周角 perigon
底 base
边 side
高 height
三角形 triangle
锐角三角形 acute triangle
直角三角形 right triangle
直角边 leg
斜边 hypotenuse
勾股定理 Pythagorean theorem
钝角三角形 obtuse triangle
不等边三角形 scalene triangle
等腰三角形 isosceles triangle
等边三角形 equilateral triangle
四边形 quadrilateral
平行四边形 parallelogram
矩形 rectangle
长 length
宽 width
菱形 rhomb, rhombus, rhombi(pl.), diamond
正方形 square
梯形 trapezoid
直角梯形 right trapezoid
等腰梯形 isosceles trapezoid
多边形 polygon
正多边形 equilateral polygon
圆 circle
圆心 centre(BrE), center(AmE)
半径 radius
直径 diameter
圆周率 pi
弧 arc
半圆 semicircle
扇形 sector
环 ring
椭圆 ellipse
圆周 circumference
周长 perimeter
面积 area
轨迹 locus, loca(pl.)
相似 similar
全等 congruent
四面体 tetrahedron
五面体 pentahedron
六面体 hexahedron
平行六面体 parallelepiped
立方体 cube
多面体 polyhedron
棱锥 pyramid
棱柱 prism
棱台 frustum of a prism
旋转 rotation
轴 axis
圆锥 cone
圆柱 cylinder
圆台 frustum of a cone
球 sphere
半球 hemisphere
底面 undersurface
表面积 surface area
体积 volume
空间 space
坐标系 coordinates
坐标轴 x-axis, y-axis, z-axis
横坐标 x-coordinate
纵坐标 y-coordinate
原点 origin
双曲线 hyperbola
抛物线 parabola
三角 trigonometry
正弦 sine
余弦 cosine
正切 tangent
余切 cotangent
正割 secant
余割 cosecant
反正弦 arc sine
反余弦 arc cosine
反正切 arc tangent
反余切 arc cotangent
反正割 arc secant
反余割 arc cosecant
相位 phase
周期 period
振幅 amplitude
内心 incentre(BrE), incenter(AmE)
外心 excentre(BrE), excenter(AmE)
旁心 escentre(BrE), escenter(AmE)
垂心 orthocentre(BrE), orthocenter(AmE)
重心 barycentre(BrE), barycenter(AmE)
内切圆 inscribed circle
外切圆 circumcircle
统计 statistics
平均数 average
加权平均数 weighted average
方差 variance
标准差 standard deviation

比例 propotion
百分比 percent
百分点 percentage
百分位数 percentile
排列 permutation
组合 combination
概率 probability
分布 distribution
正态分布 normal distribution
条形统计图 bar graph
柱形统计图 frequency histogram
折线统计图 frequency polygon
曲线统计图 curve diagram
扇形统计图 pie diagram
参考技术A 3的4次方 = 3 to the power of 4
5的3次 = 5 cubed

(对不起,之前弄错了 中文太差了 ><)

函数 = function
二次函数 = quadratic function
反函数 = inverse function
正比例函数 = linear function

其他的楼上那位的都包括了 =]

如果你想要一些英文数学笔记,告诉我我可以发给你。
参考技术B 3的4次方
3 to the power of 4
3 to the fourth power

5的3次方分之3的5次方
3 to the power of 5 over 5 to the power of 3

开根号
square root of

数字(9)代替字母(x)
substitute 9 in the equation for x

函数
function

反函数
inverse function

正比例函数
linear function

下面两个网站数学词汇超多,自己查就行了, 我就不占空间了.
http://www.hxen.com/word/sxwl/
http://www.mfyyw.com/cihui/ShowArticle.asp?ArticleID=76101
参考技术C 加是plus. 减是minus. 乘是times. 除是divide

公理 axiom

定理 theorem

计算 calculation

运算 operation

证明 prove

假设 hypothesis, hypotheses(pl.)

命题 proposition

算术 arithmetic

加 plus(prep.), add(v.), addition(n.)

被加数 augend, summand

加数 addend

和 sum

减 minus(prep.), subtract(v.), subtraction(n.)

被减数 minuend

减数 subtrahend

差 remainder

乘 times(prep.), multiply(v.), multiplication(n.)

被乘数 multiplicand, faciend

乘数 multiplicator

积 product

除 divided by(prep.), divide(v.), division(n.)

被除数 dividend

除数 divisor

商 quotient

等于 equals, is equal to, is equivalent to

大于 is greater than

小于 is lesser than

大于等于 is equal or greater than

小于等于 is equal or lesser than

运算符 operator

数字 digit

数 number

自然数 natural number

整数 integer

小数 decimal

小数点 decimal point

分数 fraction

分子 numerator

分母 denominator

比 ratio

正 positive

负 negative

零 null, zero, nought, nil

十进制 decimal system

二进制 binary system

十六进制 hexadecimal system

权 weight, significance

进位 carry

截尾 truncation

四舍五入 round

下舍入 round down

上舍入 round up

有效数字 significant digit

无效数字 insignificant digit

代数 algebra

公式 formula, formulae(pl.)

单项式 monomial

多项式 polynomial, multinomial

系数 coefficient

未知数 unknown, x-factor, y-factor, z-factor

等式,方程式 equation

一次方程 simple equation

二次方程 quadratic equation

三次方程 cubic equation

四次方程 quartic equation

不等式 inequation

阶乘 factorial

对数 logarithm

指数,幂 exponent

乘方 power

二次方,平方 square

三次方,立方 cube

四次方 the power of four, the fourth power

n次方 the power of n, the nth power

开方 evolution, extraction

二次方根,平方根 square root

三次方根,立方根 cube root

四次方根 the root of four, the fourth root

n次方根 the root of n, the nth root

集合 aggregate

元素 element

空集 void

子集 subset

交集 intersection

并集 union

补集 complement

映射 mapping

函数 function

定义域 domain, field of definition

值域 range

常量 constant

变量 variable

单调性 monotonicity

奇偶性 parity

周期性 periodicity

图象 image

数列,级数 series

微积分 calculus

微分 differential

导数 derivative

极限 limit

无穷大 infinite(a.) infinity(n.)

无穷小 infinitesimal

积分 integral

定积分 definite integral

不定积分 indefinite integral

有理数 rational number

无理数 irrational number

实数 real number

虚数 imaginary number

复数 complex number

矩阵 matrix

行列式 determinant

几何 geometry

点 point

线 line

面 plane

体 solid

线段 segment

射线 radial

平行 parallel

相交 intersect

角 angle

角度 degree

弧度 radian

锐角 acute angle

直角 right angle

钝角 obtuse angle

平角 straight angle

周角 perigon

底 base

边 side

高 height
三角形 triangle

锐角三角形 acute triangle

直角三角形 right triangle

直角边 leg

斜边 hypotenuse

勾股定理 Pythagorean theorem

钝角三角形 obtuse triangle

不等边三角形 scalene triangle

等腰三角形 isosceles triangle

等边三角形 equilateral triangle

四边形 quadrilateral

平行四边形 parallelogram

矩形 rectangle

长 length

宽 width

菱形 rhomb, rhombus, rhombi(pl.), diamond

正方形 square

梯形 trapezoid

直角梯形 right trapezoid

等腰梯形 isosceles trapezoid

五边形 pentagon

六边形 hexagon

七边形 heptagon

八边形 octagon

九边形 enneagon

十边形 decagon

十一边形 hendecagon

十二边形 dodecagon

多边形 polygon

正多边形 equilateral polygon

圆 circle

圆心 centre(BrE), center(AmE)

半径 radius

直径 diameter

圆周率 pi

弧 arc

半圆 semicircle

扇形 sector

环 ring

椭圆 ellipse

圆周 circumference

周长 perimeter

面积 area

轨迹 locus, loca(pl.)

相似 similar

全等 congruent

四面体 tetrahedron

五面体 pentahedron

六面体 hexahedron

平行六面体 parallelepiped

立方体 cube

七面体 heptahedron

八面体 octahedron

九面体 enneahedron

十面体 decahedron

十一面体 hendecahedron

十二面体 dodecahedron

二十面体 icosahedron

多面体 polyhedron

棱锥 pyramid

棱柱 prism

棱台 frustum of a prism

旋转 rotation

轴 axis

圆锥 cone

圆柱 cylinder

圆台 frustum of a cone

球 sphere

半球 hemisphere

底面 undersurface

表面积 surface area

体积 volume

空间 space

坐标系 coordinates

坐标轴 x-axis, y-axis, z-axis

横坐标 x-coordinate

纵坐标 y-coordinate

原点 origin

双曲线 hyperbola

抛物线 parabola

三角 trigonometry

正弦 sine

余弦 cosine

正切 tangent

余切 cotangent

正割 secant

余割 cosecant

反正弦 arc sine

反余弦 arc cosine

反正切 arc tangent

反余切 arc cotangent

反正割 arc secant

反余割 arc cosecant

相位 phase

周期 period

振幅 amplitude

内心 incentre(BrE), incenter(AmE)

外心 excentre(BrE), excenter(AmE)

旁心 escentre(BrE), escenter(AmE)

垂心 orthocentre(BrE), orthocenter(AmE)

重心 barycentre(BrE), barycenter(AmE)

内切圆 inscribed circle

外切圆 circumcircle

统计 statistics

平均数 average

加权平均数 weighted average

方差 variance

标准差 root-mean-square deviation, standard deviation

比例 propotion

百分比 percent

百分点 percentage

百分位数 percentile

排列 permutation

组合 combination

概率,或然率 probability

分布 distribution

正态分布 normal distribution

非正态分布 abnormal distribution

图表 graph

条形统计图 bar graph

柱形统计图 histogram

折线统计图 broken line graph

曲线统计图 curve diagram

扇形统计图 pie diagram

定理 theorem

计算 calculation

运算 operation

证明 prove

假设 hypothesis, hypotheses(pl.)

命题 proposition

算术 arithmetic

加 plus(prep.), add(v.), addition(n.)

被加数 augend, summand

加数 addend

和 sum

减 minus(prep.), subtract(v.), subtraction(n.)

被减数 minuend

减数 subtrahend

差 remainder

乘 times(prep.), multiply(v.), multiplication(n.)

被乘数 multiplicand, faciend

乘数 multiplicator

积 product

除 divided by(prep.), divide(v.), division(n.)

被除数 dividend

除数 divisor

商 quotient

等于 equals, is equal to, is equivalent to

大于 is greater than

小于 is lesser than

大于等于 is equal or greater than

小于等于 is equal or lesser than

运算符 operator

数字 digit

数 number

自然数 natural number

整数 integer

小数 decimal

小数点 decimal point

分数 fraction

分子 numerator

分母 denominator

比 ratio

正 positive

负 negative

零 null, zero, nought, nil

十进制 decimal system

二进制 binary system

十六进制 hexadecimal system

权 weight, significance

进位 carry

截尾 truncation

四舍五入 round

下舍入 round down

上舍入 round up

有效数字 significant digit

无效数字 insignificant digit

代数 algebra

公式 formula, formulae(pl.)

单项式 monomial

多项式 polynomial, multinomial

系数 coefficient

未知数 unknown, x-factor, y-factor, z-factor

等式,方程式 equation

一次方程 simple equation

二次方程 quadratic equation

三次方程 cubic equation

四次方程 quartic equation

不等式 inequation

阶乘 factorial

对数 logarithm

指数,幂 exponent

乘方 power

二次方,平方 square

三次方,立方 cube

四次方 the power of four, the fourth power

n次方 the power of n, the nth power

开方 evolution, extraction

二次方根,平方根 square root

三次方根,立方根 cube root

四次方根 the root of four, the fourth root

n次方根 the root of n, the nth root

集合 aggregate

元素 element

空集 void

子集 subset

交集 intersection

并集 union

补集 complement

映射 mapping

函数 function

定义域 domain, field of definition

值域 range

常量 constant

变量 variable

单调性 monotonicity

奇偶性 parity

周期性 periodicity

图象 image

数列,级数 series

微积分 calculus

微分 differential

导数 derivative

极限 limit

无穷大 infinite(a.) infinity(n.)

无穷小 infinitesimal

积分 integral

定积分 definite integral

不定积分 indefinite integral

有理数 rational number

无理数 irrational number

实数 real number

虚数 imaginary number

复数 complex number

矩阵 matrix

行列式 determinant

几何 geometry

点 point

线 line

面 plane

体 solid

线段 segment

射线 radial

平行 parallel

相交 intersect

角 angle

角度 degree

弧度 radian

锐角 acute angle

直角 right angle

钝角 obtuse angle

平角 straight angle

周角 perigon

底 base

边 side

高 height

三角形 triangle

锐角三角形 acute triangle

直角三角形 right triangle

直角边 leg

斜边 hypotenuse

勾股定理 Pythagorean theorem

钝角三角形 obtuse triangle

不等边三角形 scalene triangle

等腰三角形 isosceles triangle

等边三角形 equilateral triangle

四边形 quadrilateral

平行四边形 parallelogram

矩形 rectangle

长 length

宽 width

菱形 rhomb, rhombus, rhombi(pl.), diamond

正方形 square

梯形 trapezoid

直角梯形 right trapezoid

等腰梯形 isosceles trapezoid

五边形 pentagon

六边形 hexagon

七边形 heptagon

八边形 octagon

九边形 enneagon

十边形 decagon

十一边形 hendecagon

十二边形 dodecagon

多边形 polygon

正多边形 equilateral polygon

圆 circle

圆心 centre(BrE), center(AmE)

半径 radius

直径 diameter

圆周率 pi

弧 arc

半圆 semicircle

扇形 sector

环 ring

椭圆 ellipse

圆周 circumference

周长 perimeter

面积 area

轨迹 locus, loca(pl.)

相似 similar

全等 congruent

四面体 tetrahedron

五面体 pentahedron

六面体 hexahedron

平行六面体 parallelepiped

立方体 cube

七面体 heptahedron

八面体 octahedron

九面体 enneahedron

十面体 decahedron

十一面体 hendecahedron

十二面体 dodecahedron

二十面体 icosahedron

多面体 polyhedron

棱锥 pyramid

棱柱 prism

棱台 frustum of a prism

旋转 rotation

轴 axis

圆锥 cone

圆柱 cylinder

圆台 frustum of a cone

球 sphere

半球 hemisphere

底面 undersurface

表面积 surface area

体积 volume

空间 space

坐标系 coordinates

坐标轴 x-axis, y-axis, z-axis

横坐标 x-coordinate

纵坐标 y-coordinate

原点 origin

双曲线 hyperbola

抛物线 parabola

三角 trigonometry

正弦 sine

余弦 cosine

正切 tangent

余切 cotangent

正割 secant

余割 cosecant

反正弦 arc sine

反余弦 arc cosine

反正切 arc tangent

反余切 arc cotangent

反正割 arc secant

反余割 arc cosecant

相位 phase

周期 period

振幅 amplitude

内心 incentre(BrE), incenter(AmE)

外心 excentre(BrE), excenter(AmE)

旁心 escentre(BrE), escenter(AmE)

垂心 orthocentre(BrE), orthocenter(AmE)

重心 barycentre(BrE), barycenter(AmE)

内切圆 inscribed circle

外切圆 circumcircle

统计 statistics

平均数 average

加权平均数 weighted average

方差 variance

标准差 root-mean-square deviation, standard deviation

比例 propotion

百分比 percent

百分点 percentage

百分位数 percentile

排列 permutation

组合 combination

概率,或然率 probability

分布 distribution

正态分布 normal distribution

非正态分布 abnormal distribution

图表 graph

条形统计图 bar graph

柱形统计图 histogram

折线统计图 broken line graph

曲线统计图 curve diagram

扇形统计图 pie diagram

参考资料:http://www.flander.com.cn/bbs/dispbbs.asp?BoardID=3&ID=49&Page=1

参考技术D 3
to
the
fourth
数学
mathematics,maths
公理
axiom
定理
theorem
计算
calculation
运算
operation
证明
prove
假设
hypothesis,
hypotheses(pl.)
命题
proposition
定理
theorem
定义
defination
算术
arithmetic
数字
digit

number
自然数
natural
number
整数
integer
小数
decimal
小数点
decimal
point
分数
fraction
分子
numerator
分母
denominator

plus(prep.),
add(v.),
addition(n.)
被加数
augend,
summand
加数
addend

sum

minus(prep.),
subtract(v.),
subtraction(n.)
被减数
minuend
减数
subtrahend

remainder,
difference

times(prep.),
multiply(v.),
multiplication(n.)
被乘数
multiplicand,
faciend
乘数
multiplicator

product

divided
by(prep.),
divide(v.),
division(n.)
被除数
dividend
除数
divisor

quotient
等于
equals,
is
equal
to
大于
greater
than
小于
less
than
大于等于
equal
or
greater
than
小于等于
equal
or
less
than
运算符
operator

ratio

positive

negative

null,
zero,
nought,
nil
十进制
decimal
system
二进制
binary
system
十六进制
hexadecimal
system

weight,
significance
进位
carry
截尾
truncation
四舍五入
round
下舍入
round
down
上舍入
round
up
有效数字
significant
figure
代数
algebra
公式
formula,
formulae(pl.)
单项式
monomial
多项式
polynomial,
multinomial
系数
coefficient
未知数
unknown
等式,方程式
equation
一次方程
linear
equation
二次方程
quadratic
equation
三次方程
cubic
equation
四次方程
quartic
equation
不等式
inequality
阶乘
factorial
对数
logarithm
指数,幂
exponent
乘方
power
二次方,平方
square
三次方,立方
cube
四次方
the
power
of
four,
the
fourth
power
n次方
the
power
of
n,
the
nth
power
开方
evolution,
extraction
二次方根,平方根
square
root
三次方根,立方根
cube
root
四次方根
the
root
of
four,
the
fourth
root
n次方根
the
root
of
n,
the
nth
root
集合
set
元素
element
空集
empty
set
子集
subset
交集
intersection
并集
union
补集
complement
映射
mapping
函数
function
定义域
domain
值域
range
常量
constant
变量
variable
单调性
monotonicity
奇偶性
parity
周期性
periodicity
图象
image
数列,级数
series,
sequence
微积分
calculus
微分
differentiation
导数
derivative
极限
limit
无穷
infinite(a.)
infinity(n.)
积分
integral
定积分
definite
integral
不定积分
indefinite
integral
有理数
rational
number
无理数
irrational
number
实数
real
number
虚数
imaginary
number
复数
complex
number
矩阵
matrix
行列式
determinant
几何
geometry

point
线
line

plane

solid
线段
segment
射线
radial
平行
parallel
相交
intersect

angle
角度
degree
弧度
radian
锐角
acute
angle
直角
right
angle
钝角
obtuse
angle
平角
straight
angle
周角
perigon

base

side

height
三角形
triangle
锐角三角形
acute
triangle
直角三角形
right
triangle
直角边
leg
斜边
hypotenuse
勾股定理
Pythagorean
theorem
钝角三角形
obtuse
triangle
不等边三角形
scalene
triangle
等腰三角形
isosceles
triangle
等边三角形
equilateral
triangle
四边形
quadrilateral
平行四边形
parallelogram
矩形
rectangle

length

width
菱形
rhomb,
rhombus,
rhombi(pl.),
diamond
正方形
square
梯形
trapezoid
直角梯形
right
trapezoid
等腰梯形
isosceles
trapezoid
多边形
polygon
正多边形
equilateral
polygon

circle
圆心
centre(BrE),
center(AmE)
半径
radius
直径
diameter
圆周率
pi

arc
半圆
semicircle
扇形
sector

ring
椭圆
ellipse
圆周
circumference
周长
perimeter
面积
area
轨迹
locus,
loca(pl.)
相似
similar
全等
congruent
四面体
tetrahedron
五面体
pentahedron
六面体
hexahedron
平行六面体
parallelepiped
立方体
cube
多面体
polyhedron
棱锥
pyramid
棱柱
prism
棱台
frustum
of
a
prism
旋转
rotation

axis
圆锥
cone
圆柱
cylinder
圆台
frustum
of
a
cone

sphere
半球
hemisphere
底面
undersurface
表面积
surface
area
体积
volume
空间
space
坐标系
coordinates
坐标轴
x-axis,
y-axis,
z-axis
横坐标
x-coordinate
纵坐标
y-coordinate
原点
origin
双曲线
hyperbola
抛物线
parabola
三角
trigonometry
正弦
sine
余弦
cosine
正切
tangent
余切
cotangent
正割
secant
余割
cosecant
反正弦
arc
sine
反余弦
arc
cosine
反正切
arc
tangent
反余切
arc
cotangent
反正割
arc
secant
反余割
arc
cosecant
相位
phase
周期
period
振幅
amplitude
内心
incentre(BrE),
incenter(AmE)
外心
excentre(BrE),
excenter(AmE)
旁心
escentre(BrE),
escenter(AmE)
垂心
orthocentre(BrE),
orthocenter(AmE)
重心
barycentre(BrE),
barycenter(AmE)
内切圆
inscribed
circle
外切圆
circumcircle
统计
statistics
平均数
average
加权平均数
weighted
average
方差
variance
标准差
standard
deviation
比例
propotion
百分比
percent
百分点
percentage
百分位数
percentile
排列
permutation
组合
combination
概率
probability
分布
distribution
正态分布
normal
distribution
条形统计图
bar
graph
柱形统计图
frequency
histogram
折线统计图
frequency
polygon
曲线统计图
curve
diagram
扇形统计图
pie
diagram

从字符串评估数学表达式并将其插入堆栈

【中文标题】从字符串评估数学表达式并将其插入堆栈【英文标题】:Evaluating mathematical expression from a string and inserting it on stack 【发布时间】:2017-05-17 15:26:45 【问题描述】:

我正在尝试构建一个任意精度的计算器。 我在链表中​​表示数字(一个节点是一个数字),我想将它们存储在堆栈中。 但是,我似乎无法弄清楚如何在保持正确的数学运算顺序的同时将作为字符串接收的数学表达式分开。

例如,如果插入的表达式是6*8-2+8-8*9/4,我将数字表示为链表并将它们插入堆栈,并将运算符插入不同的堆栈,然后我想弹出每个计算的参数并再次推送结果,以此类推,直到我得到最终结果。

我的问题是,我怎样才能实现这个并且仍然遵循数学运算顺序?

【问题讨论】:

一种常用的方法是首先使用 Dijkstra 的 Shunting-yard algorithm 将表达式转换为 RPN 首先使用标准库的shlex进行分词,然后提出语法,实现解析器。我发现 shift reduce 解析器是最容易理解和实现的。我最近在这方面做了一个玩具项目——github上的shreducers。 请看这个问题和好的回复。 ***.com/questions/28256/… 【参考方案1】:

你可以试试eval

eval("6*8-2+8-8*9/4")

这会给你36

编辑:

如果 eval 不可行,可以尝试operator 将字符串运算符转换为数学运算符:

import operator
operations = 
    '+' : operator.add,
    '-' : operator.sub,
    '*' : operator.mul,
    '/' : operator.div,
    '%' : operator.mod,
    '^' : operator.xor

那么也许您可以遍历字符串并以这种方式评估它? (我现在会考虑循环部分,如果我得到任何好的结果,我会编辑我的答案)

【讨论】:

我希望。这是一个大学项目,我必须完全按照我写的那样去做。 啊,很公平,如果我想出任何有用的东西,我会思考并更新我的答案:) 谢谢您的好心先生! 如果你按照严格的从左到右的顺序计算东西,这样做是可以的,但是如果你想使用通常的数学优先规则并且你需要处理带括号的表达式,它就会变得棘手。 @PM2Ring 是的,我确信我的答案有更好的解决方案,我将阅读您之前在评论中提到的内容,看起来真的很有趣且有用! :)

以上是关于数学英文表达!拜托咯!的主要内容,如果未能解决你的问题,请参考以下文章

一道数学概率问题

M打横写那个数学符号叫啥啊?有啥意义??

一道排列组合数学问题

使用正则表达式拆分数学表达式

检查两个数学表达式是不是等价

Latex 数学表达式对齐