G
G
geiwoooj2021-12-15 11:25:08
Python
geiwoooj, 2021-12-15 11:25:08

How to convert mathematical formulas to pascal?

61b9a63c3d9c2497150896.png

You need to either convert to python or pascal. thanks in advance

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kirill Palchevsky, 2021-12-15
@geiwoooj

import math

a = int(input("Введите A: "))
b = int(input("Введите B: "))
c = int(input("Введите C: "))
x = int(input("Введите X: "))


if x < b:
    y = math.log10(abs(a + x)) * math.cos(abs(x ** 3))
elif b <= x and x <= c:
    y = math.e ** 1.2 - math.sqrt(abs(a + x))
elif x > c:
    y = (math.sqrt(abs(a + x)) ** 1 / 3) / (a - x)
print(y)

H
HemulGM, 2021-12-15
@HemulGM

uses Math;

begin
  var a, b, c, x: integer;
  write('Введите A: '); readln(a);
  write('Введите B: '); readln(b);
  write('Введите C: '); readln(c);
  write('Введите X: '); readln(x);

  var y: Extended;
  if x < b then
    y := log10(abs(a + x)) * cos(abs(Power(x, 3)))
  else if (b <= x) and (x <= c) then
    y := Exp(1.2) - sqrt(abs(a + x))
  else if x > c then
    y := (Power(sqrt(abs(a + x)), 1 / 3)) / (a - x);
  writeln(y);
end.

S
Sanes, 2015-07-09
@Sanes

Tickets + UserProfile2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question