Answer the question
In order to leave comments, you need to log in
Pascal problem, the answer is very different from the sample, what am I doing wrong?
There is a task:
(the question mark is beta)
I'm trying to solve in pascal (console delphi)
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils,
Math;
var
xn,i:integer;
a,b,z,beta,y:real;
arr:array of real;
begin
write('input quantity X: ');
readln(xn);
SetLength(arr,xn);
for i:=0 to High(arr) do arr[i]:=0;
for i:=0 to High(arr) do
begin
writeln('Input a,b,z,beta for x',i,': ');
write('a=');
readln(a);
write('b=');
readln(b);
write('z=');
readln(z);
write('beta=');
readln(beta);
arr[i]:=(z*z*z)-b+a*a/(Tan(2*beta)*Tan(2*beta));
end;
for i:=0 to High(arr) do y:=y+arr[i];
writeln('y=',y:3:2);
readln;
end.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question