Помогите решить)Паскаль 9 класс!Задания во вложениях!!

0 голосов
28 просмотров

Помогите решить)Паскаль 9 класс!Задания во вложениях!!


image

Информатика (61 баллов) | 28 просмотров
Дан 1 ответ
0 голосов
Правильный ответ

var

  a, b, c, m : integer;

begin

  read (a, b, c);

  m := a;

  if b < m then m := b;

  if c < m then m := c;

  writeln (m);

end.

 

var

  a : array [1..3] of integer;

  i, m : integer;

begin

  m := a[1];

  for i := 2 to 3 do

    if a[i] < m then m := a[i];

  writeln (m);

end.

 

var

  a, b, c : integer;

begin

  read (a, b, c);

  if (a <= b) and (a <= c) then writeln (a)</p>

  else if (b <= c) and (b <= a)  then writeln (b)</p>

  else writeln (c);

end.

 

__________________________________

 

var

  a, b, c : integer;

 

procedure swap (var a, b : integer); 
var

  c : integer; 
begin 
  c := a; 
  a := b; 
  b := c; 
end; 

begin

  read (a, b, c);
  if a > b then swap (a,b); 
  if a > c then swap (a,c); 
  if b > c then swap (b,c);

   write (a, ' ', b, ' ', c);
end.

_____________________________________________

 

var

  a, b, c : real;

  d, x1, x2 : real;

 

begin

  read (a, b, c);

  d := sqr (b) - 4 * a * c;

  if d < 0 then writeln ('Корней нет')

  else

  begin

    x1 := (-b + sqrt (d)) / (2 * a);

    x2 := (-b - sqrt (d)) / (2 * a);

   if d = 0 then writeln ('x = ', x1)

   else writeln ('x1 = ', x2, ';  x2 = ', x1);

  end;

end.

(4.6k баллов)