Var
a, b, c, d: integer;
begin
write ('Введите три числа: ');
readln (a, b, c);
if a >= b then
d := a
else
d := b;
if c > d then
d := c;
writeln ('Максимальное из них: ', d);
readln
end.
Const
a = -0.5;
b = 2;
h = 0.15;
x1 = 0;
x2 = 3;
var
x, y: real;
begin
writeln('ТАБЛИЦА ФУНКЦИИ Y(X)');
writeln(' X Y');
x := x1;
repeat
if x < 1 then y := 1
else
if x <= 2 then y := a * sqr(x) * ln(x)
else y := exp(a * x) * cos(b * x);
writeln(x:4:2, y:12:7);
x := x + h
until x > x2 + 0.0000001
{добавка к х2 для компенсации погрешности представления h в ЭВМ}
end.
Тестовое решение:
ТАБЛИЦА ФУНКЦИИ Y(X)
X Y
0.00 1.0000000
0.15 1.0000000
0.30 1.0000000
0.45 1.0000000
0.60 1.0000000
0.75 1.0000000
0.90 1.0000000
1.05 -0.0268956
1.20 -0.1312715
1.35 -0.2734703
1.50 -0.4561482
1.65 -0.6816804
1.80 -0.9522144
1.95 -1.2697106
2.10 -0.1715608
2.25 -0.0684354
2.40 0.0263542
2.55 0.1056187
2.70 0.1645379
2.85 0.2007555
3.00 0.2142429
Var n,m:integer;
mn:set of integer;
b:boolean;
begin
write('n = '); readln(n);
write('m = '); readln(m);
mn:=[];
while n>0 do
begin
mn:=mn+[n mod 10];
n:=n div 10;
end;
b:=false;
while m>0 do
begin
if (m mod 10) in mn then b:=true;
m:=m div 10;
end;
if b then writeln('Да') else writeln('Нет');
end.
Пример:
n = 13579
m = 6541
Да
Var a, k: real
BEGIN
uses crt; clrscr;
write ('Vvedite 1 chlen posledovatelnosti'); readln (a);
k:=0;
while a > 0 do
begin
if (a > 10) then k := a;
write ('Vvedite ocherednoy chlen posledovatelnosti'); readln (a);
end;
writeln (k);
END.