Оптимальні програми обчислення виразів, Детальна інформація
Оптимальні програми обчислення виразів
ReadLn(Tab[i].c);
WriteLn('Введіть значення ',Tab[i].c);
ReadLn(Tab[i].v);
End;
WriteLn('Введіь арифметичний вираз у інфіксній формі ');
ReadLn(s);
InputExpression:=s;
End;
Function IsOperation(c:Char):Boolean;
Begin
If c in ['/','*','+','-','^'] Then IsOperation:=True
Else IsOperation:=False;
End;
Function IsVariable(c:Char):Integer;
Var i:Integer;
Begin
For i:=1 To N Do
If Tab[i].c=c Then
Begin
IsVariable:=i;
Exit;
End;
IsVariable:=0;
End;
Function MakeOperation(p1,p2:Real; Op:Char):Real;
Begin
Case Op Of
'+' : MakeOperation:=p1+p2;
'-' : MakeOperation:=p1-p2;
'*' : MakeOperation:=p1*p2;
WriteLn('Введіть значення ',Tab[i].c);
ReadLn(Tab[i].v);
End;
WriteLn('Введіь арифметичний вираз у інфіксній формі ');
ReadLn(s);
InputExpression:=s;
End;
Function IsOperation(c:Char):Boolean;
Begin
If c in ['/','*','+','-','^'] Then IsOperation:=True
Else IsOperation:=False;
End;
Function IsVariable(c:Char):Integer;
Var i:Integer;
Begin
For i:=1 To N Do
If Tab[i].c=c Then
Begin
IsVariable:=i;
Exit;
End;
IsVariable:=0;
End;
Function MakeOperation(p1,p2:Real; Op:Char):Real;
Begin
Case Op Of
'+' : MakeOperation:=p1+p2;
'-' : MakeOperation:=p1-p2;
'*' : MakeOperation:=p1*p2;
The online video editor trusted by teams to make professional video in
minutes
© Referats, Inc · All rights reserved 2021