• Найдите ошибку. Вместо бОльшего числа, выводит 0.

    program bolsheyechislo;
    var a, b, c, d, e, max, max1, max2 : integer;
    function MaxChislo: integer;
    begin
    if max1 > max2
    then max := max1
    else max := max2;
    end;
    begin
    writeln('Введите 5 чисел:');
    readln(a, b, c, d, e);
    max1 := a;
    max2 := b;
    max := MaxChislo;
    max1 := c;
    max2 := max;
    max := MaxChislo;
    max1 := d;
    max2 := max;
    max := MaxChislo;
    max1 := e;
    max2 := max;
    max := MaxChislo;
    writeln('Самое большое число: ', max );
    end.

Ответы 3

  • А почему не работает код, написанный мной? Смысл то тот же.
    • Автор:

      lolafoley
    • 6 лет назад
    • 0
  • Потому что в коде много ошибок и нелепостей.
    • Автор:

      cambil
    • 6 лет назад
    • 0
  • program bolsheyechislo;

    var a, b, c, d, e, max : integer;

    function MaxChislo(x,y: integer): integer;

    begin

    if x > y

    then MaxChislo := x

    else MaxChislo := y;

    end;

    begin

    writeln('Введите 5 чисел:');

    readln(a, b, c, d, e);

    max := MaxChislo(MaxChislo(MaxChislo(a,b),MaxChislo(c,d)),e);

    writeln('Самое большое число: ', max );

    end.

    Пример:

    Введите 5 чисел:

    12 45 38 79 50

    Самое большое число: 79

    • Автор:

      peppa pig
    • 6 лет назад
    • 0
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years