level 9
🔯cyb酱🔯
楼主
直接发代码
该计算器是第一代,输入加减乘除的运算式子即可,暂时不可以括号和函数
program calculator;
function zh1(instr:string):extended;
var point,code:integer;
before,after:extended;
begin
point:=pos(*.*,instr);
if point=0 then
begin
val(instr,zh1,code);
end
else
begin
val(copy(instr,1,point-1),before,code);
val(copy(instr,point+1,length(instr)-point),after,code);
zh1:=before+after/exp(ln(10)*(length(instr)-point))
end;
end;
function pan(instr2:string):boolean;
begin
if (instr2=*1*)or(instr2=*2*)or(instr2=*3*)or(instr2=*4*)or(instr2=*5*)or(instr2=*6*)or(instr2=*7*)or(instr2=*8*)or(instr2=*9*)or(instr2=*0*)or(instr2=*.*) then
begin
pan:=true;
end
else
begin
pan:=false;
end;
end;
function jiejue(str9:string):string;
var strdick:string;
i,j,where,num1,num2,lll:integer;
n1,n2,ans:extended;
begin
str9:=*0+*+str9+*+0*;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
for i:=1 to length(str9) do
begin
if pos(*^+*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*^+*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=exp(ln(n1)*n2);
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*^-*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*^-*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=exp(ln(n1)*-n2);
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(**+*,str9)=0 then
begin
break;
end
else
begin
where:=pos(**+*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1*n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(**-*,str9)=0 then
begin
break;
end
else
begin
where:=pos(**-*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1*-n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*/+*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*/+*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1/n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*/-*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*/-*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1/-n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*^*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*^*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+1 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+1,num2-where));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=exp(ln(n1)*n2);
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(***,str9)=0 then
begin
break;
end
else
begin
where:=pos(***,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+1 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+1,num2-where));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1*n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*/*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*/*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+1 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+1,num2-where));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1/n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
for i:=1 to length(str9) do
begin
if pan(copy(str9,i,1)) then
begin
end
else
begin
num1:=1;
num2:=i-1;
break;
end;
end;
ans:=zh1(copy(str9,num1,num2-num1+1));
str9:=copy(str9,num2+1,length(str9)-num2);
while (pos(*+*,str9)>0)or(pos(*-*,str9)>0) do
begin
num1:=2;
for i:=2 to length(str9) do
begin
if pan(copy(str9,i,1)) then
begin
num2:=i;
end
else
begin
num2:=i-1;
break;
end;
end;
if copy(str9,1,1)=*+*
then
begin
ans:=ans+zh1(copy(str9,num1,num2-num1+1));
str9:=copy(str9,num2+1,length(str9)-num2);
end;
if copy(str9,1,1)=*-* then
begin
ans:=ans-zh1(copy(str9,num1,num2-num1+1));
str9:=copy(str9,num2+1,length(str9)-num2);
end;
end;
str(ans:0:5,str9);
exit(str9);
end;
var a:string;
begin
while(1=1) do
begin
readln(a);
writeln(jiejue(a));
end;
end.
2014年11月07日 13点11分
1
该计算器是第一代,输入加减乘除的运算式子即可,暂时不可以括号和函数
program calculator;
function zh1(instr:string):extended;
var point,code:integer;
before,after:extended;
begin
point:=pos(*.*,instr);
if point=0 then
begin
val(instr,zh1,code);
end
else
begin
val(copy(instr,1,point-1),before,code);
val(copy(instr,point+1,length(instr)-point),after,code);
zh1:=before+after/exp(ln(10)*(length(instr)-point))
end;
end;
function pan(instr2:string):boolean;
begin
if (instr2=*1*)or(instr2=*2*)or(instr2=*3*)or(instr2=*4*)or(instr2=*5*)or(instr2=*6*)or(instr2=*7*)or(instr2=*8*)or(instr2=*9*)or(instr2=*0*)or(instr2=*.*) then
begin
pan:=true;
end
else
begin
pan:=false;
end;
end;
function jiejue(str9:string):string;
var strdick:string;
i,j,where,num1,num2,lll:integer;
n1,n2,ans:extended;
begin
str9:=*0+*+str9+*+0*;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
for i:=1 to length(str9) do
begin
if pos(*^+*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*^+*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=exp(ln(n1)*n2);
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*^-*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*^-*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=exp(ln(n1)*-n2);
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(**+*,str9)=0 then
begin
break;
end
else
begin
where:=pos(**+*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1*n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(**-*,str9)=0 then
begin
break;
end
else
begin
where:=pos(**-*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1*-n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*/+*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*/+*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1/n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*/-*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*/-*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+2 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+2,num2-where-1));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1/-n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*^*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*^*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+1 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+1,num2-where));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=exp(ln(n1)*n2);
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(***,str9)=0 then
begin
break;
end
else
begin
where:=pos(***,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+1 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+1,num2-where));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1*n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
for i:=1 to length(str9) do
begin
if pos(*/*,str9)=0 then
begin
break;
end
else
begin
where:=pos(*/*,str9);
for j:=where-1 downto 1 do
begin
num1:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num1:=j+1;
break;
end;
end;
for j:=where+1 to length(str9) do
begin
num2:=j;
if pan(copy(str9,j,1)) then
begin
end
else
begin
num2:=j-1;
break;
end;
end;
n1:=zh1(copy(str9,num1,where-num1));
n2:=zh1(copy(str9,where+1,num2-where));
if copy(str9,num1,1)=*_* then
begin
n1:=-n1;
end;
if copy(str9,num2,1)=*_* then
begin
n2:=-n2;
end;
ans:=n1/n2;
str(ans:0:5,strdick);
str9:=copy(str9,1,num1-1)+strdick+copy(str9,num2+1,length(str9)-num2);
end;
end;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*++*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*++* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*+-*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*+-* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*-+*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*-+* then
begin
str9:=copy(str9,1,i-1)+*-*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
lll:=length(str9);
while (pos(*--*,str9)>0) do
begin
for i:=1 to lll do
begin
if copy(str9,i,2)=*--* then
begin
str9:=copy(str9,1,i-1)+*+*+copy(str9,i+2,length(str9)-i-1);
break;
end;
end;
end;
for i:=1 to length(str9) do
begin
if pan(copy(str9,i,1)) then
begin
end
else
begin
num1:=1;
num2:=i-1;
break;
end;
end;
ans:=zh1(copy(str9,num1,num2-num1+1));
str9:=copy(str9,num2+1,length(str9)-num2);
while (pos(*+*,str9)>0)or(pos(*-*,str9)>0) do
begin
num1:=2;
for i:=2 to length(str9) do
begin
if pan(copy(str9,i,1)) then
begin
num2:=i;
end
else
begin
num2:=i-1;
break;
end;
end;
if copy(str9,1,1)=*+*
then
begin
ans:=ans+zh1(copy(str9,num1,num2-num1+1));
str9:=copy(str9,num2+1,length(str9)-num2);
end;
if copy(str9,1,1)=*-* then
begin
ans:=ans-zh1(copy(str9,num1,num2-num1+1));
str9:=copy(str9,num2+1,length(str9)-num2);
end;
end;
str(ans:0:5,str9);
exit(str9);
end;
var a:string;
begin
while(1=1) do
begin
readln(a);
writeln(jiejue(a));
end;
end.