Ćwiczenie 7 20.11.2008.
Zadanie1
Program funkcja1;
uses crt;
var x,f:real;
begin
clrscr;
writeln ('Podaj argument x');
readln (x);
if x>0 then
f:=exp(0.2*ln(x))*(1+sqrt(1+sqrt(x)))
else
f:=1/(1+sqrt(1+sqr(1+x*x)));
writeln ('f=',f:0:5);
readln
end.
Zadanie2
program funkcja2;
writeln ('Podaj x');
if x<=0 then
f:=0;
end;
if (x>0) and (x<1) then
f:=(x*(1-x))*((1+sin(1+x*x))/(1+x*x));
if (x>=1) and (x<2) then
f:=(1-x)*(x-2)*(ln(1+x*x)/ln(10));
if (x>=2) and (x<10) then
f:=(x-2)*exp(1)*((x-10)/(1+x*x));
if x>=10 then
f:=8+((x-10)/(1+x*x));
Zadanie3
program pierwiastki;
var a,b,c,x1,x2,x,d:real;
writeln ('Podaj wspolczynniki');
readln (a,b,c);
if a=0 then
writeln ('Jest to rownanie liniowe');
readln;
exit
d:=b*b-4*a*c;
if d<0 then
writeln ('Brak rozwiazan rzeczywistych');
if d=0 then
x:=(-b)/(2*a);
writeln ('x=',x:0:5);
if d>0 then
x1:=(-b-sqrt(d))/(2*a);
writeln ('x1=',x1:0:5);
x2:=(-b+sqrt(d))/(2*a);
writeln ('x2=',x2:0:5);
rako91