Цитата:
Сообщение от Гульназ.М.
Так то обе..нужны
|
Да пожалуйста - без проблем:
Код:
VAR
a,c,x,UL,LL,H:Real;
N,i:Byte;
Function Y(z:real):Real;
begin
Y:=Sqrt(z-a)+1/(z+c);
end;
BEGIN
Write('a= ');
Readln(a);
Write('c= ');
Readln(c);
Repeat
Write('Lower limit = ');
Readln(LL);
If LL<a then writeln('Error: incorrect value!');
Until LL>=a;
Repeat
Write('Upper limit = ');
Readln(UL);
If UL<=LL then writeln('Error: incorrect value!');
Until UL>LL;
Repeat
Write('Step= ');
Readln(H);
If (H<=0) or (H>(UL-LL)) then writeln('Error: incorrect value!');
Until (H>0) and (H<=(UL-LL));
N:=Round((UL-LL)/H);
For i:=0 to N do
begin
x:=LL+H*i;
Writeln(x:6:3,Y(x):15:5);
end;
Readln
END.
Код:
VAR
x,UL,LL,H:Real;
N,i:Byte;
Function Y(z:real):Real;
begin
Y:=Sqrt(z*Sqrt(z)-z*4);
end;
BEGIN
Repeat
Write('Lower limit = ');
Readln(LL);
If LL<16 then writeln('Error: lower limit must be >=16!');
Until LL>=16;
Repeat
Write('Upper limit = ');
Readln(UL);
If UL<=LL then writeln('Error: incorrect value!');
Until UL>LL;
Repeat
Write('Step= ');
Readln(H);
If (H<=0) or (H>(UL-LL)) then writeln('Error: incorrect value!');
Until (H>0) and (H<=(UL-LL));
N:=Round((UL-LL)/H);
For i:=0 to N do
begin
x:=LL+H*i;
Writeln(x:6:3,Y(x):15:5);
end;
Readln
END.