Есть ответ 👍

Перевести этот код 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
Посмотреть ответы 2

Ответы на вопрос:

lenatvoya
4,7(62 оценок)

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бит

Популярно: Информатика