Перевести этот код delphi в паскаль, program taskformula; uses var x, a, xn, xk, dx, sum, multiplnegative: real; countnegative: integer; j,m,f: real; y: real; begin writeln('a --> '); read(a); writeln(' xn --> '); read(xn); writeln(' xk --> '); read(xk); writeln(' dx --> '); read(dx); sum : = 0; multiplnegative : = 1; countnegative : = 0; x : = xn; while (x < = xk) do begin if (a+x < 0) then begin f: =(a+x)*-1; f: =ln(f)*(-1); j: = roundto(abs(a-sqr(x)) * f,-5); end else j: = roundto(abs(a-sqr(x)) * ln(a+); m: = power(sqr(x),1/3)+ power(a,1/5); if j< 0 then begin j: =j*(-1); j: = power(j, 1/3); j: =j*(-1); end else j: = power(j, 1/3); y: = roundto(j/m,-5); write('x= ',x: 5: 3,' '); writeln('y= ',y: 7: 5); if y< 0 then begin sum : = sum + y; multiplnegative : = multiplnegative * y; inc(countnegative); end; x: = x + dx; end; writeln; writeln(' y = ',countnegative); writeln('y = ',sum: 7: 5); writeln(' y = ',multiplnegative: 7: 5); readln; end.
176
461
Ответы на вопрос:
Var y, x, a, xn, xk, dx, sum, multiplnegative: real; countnegative: integer; j, m, f: real; begin write('a --> '); read(a); write(' xn --> '); read(xn); write(' xk --> '); read(xk); write(' dx --> '); read(dx); sum : = 0; multiplnegative : = 1; countnegative : = 0; x : = xn; while (x < = xk) do begin if (a + x < 0) then begin f : = (a + x) * -1; f : = ln(f) * (-1); j : = round(abs(a - sqr(x)) * f * 100000) / 100000; end else j : = round(abs(a - sqr(x)) * ln(a + x) * 100000) / 100000; m : = power(sqr(x), 1 / 3) + power(a, 1 / 5); if j < 0 then begin j : = j * (-1); j : = power(j, 1 / 3); j : = j * (-1); end else j : = power(j, 1 / 3); y : = round(j / m * 100000) / 100000; write('x= ', x: 5: 3, ' '); writeln('y= ', y: 7: 5); if y < 0 then begin sum : = sum + y; multiplnegative : = multiplnegative * y; inc(countnegative); end; x : = x + dx; end; writeln; writeln(' y = ', countnegative); writeln('y = ', sum: 7: 5); writeln(' y = ', multiplnegative: 7: 5); readln; end.
N=32= 2 в 5 степени, 60x5=300бит- одна строка300бит x 30 = 9000бит9000бит x 5 =45000битответ; 45000бит
Популярно: Информатика
-
Шмигельська11.02.2023 23:49
-
littlefoxy18.08.2020 06:14
-
alisavakhnina117.12.2022 23:01
-
Hikolog25.07.2022 22:21
-
Айлин129002.11.2020 11:53
-
bellatrissa2114.09.2020 00:43
-
FlUSHWER11.05.2023 04:56
-
Arseni0122.10.2022 06:50
-
tema3010200813.06.2020 15:10
-
perrrii01.06.2022 19:52