1.program z;var a:array [1..10] of integer; i,t:integer; s:real;beginfor i:=1 to 10 dobegina[i]:=random(1,100);write(a[i]:4);if (odd(i)) and (odd(a[i])) then begins:=s+a[i];t:=t+1;end;end;writeln;write('Cреднее арифметическое = ',s/t);end.2.program z;var a:array[1..10] of integer; max,i:integer;beginwriteln('Исходный массив');for i:=1 to 10 dobegina[i]:=random(1,100);write(a[i]:4);if a[i]>max then max:=a[i];end;writeln;writeln('Измененный массив');for i:=1 to 10 dobeginif not(odd(a[i])) then a[i]:=max;write(a[i]:4);end;end.
var a, b, c, D, x, y: real; begin readln(a, b, c); {ax^4 + bx^2 + c = 0} if a = 0 then writeln('Non-bisquare') else begin D := b * b - 4 * a * c; if D < 0 then writeln('No solutions') else begin if D = 0 then begin x := -b / 2 / a; if x < 0 then writeln('No solutions') else writeln('2 solutions: ', sqrt(x), ' ', -sqrt(x)); end else begin x := (-b + sqrt(D)) / 2 / a; y := (-b - sqrt(D)) / 2 / a; if x < 0 then writeln('No solutions'); if x = 0 then writeln('1 solution: 0'); if (x > 0) and (y < 0) then writeln('2 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3); if (x > 0) and (y = 0) then writeln('3 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3, ' 0'); if y > 0 then writeln('4 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3, ' ', sqrt(y):0:3, ' ', -sqrt(y):0:3); end; end; end; end.
begin
readln(a, b, c); {ax^4 + bx^2 + c = 0}
if a = 0 then
writeln('Non-bisquare')
else
begin
D := b * b - 4 * a * c;
if D < 0 then
writeln('No solutions')
else
begin if D = 0 then
begin x := -b / 2 / a;
if x < 0 then
writeln('No solutions')
else writeln('2 solutions: ', sqrt(x), ' ', -sqrt(x));
end
else
begin x := (-b + sqrt(D)) / 2 / a;
y := (-b - sqrt(D)) / 2 / a;
if x < 0 then writeln('No solutions');
if x = 0 then
writeln('1 solution: 0');
if (x > 0) and (y < 0) then
writeln('2 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3);
if (x > 0) and (y = 0) then
writeln('3 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3, ' 0');
if y > 0 then
writeln('4 solutions: ', sqrt(x):0:3, ' ', -sqrt(x):0:3, ' ', sqrt(y):0:3, ' ', -sqrt(y):0:3);
end;
end;
end;
end.