N
N
NEKITVULGAR2021-04-14 16:09:12
Pascal
NEKITVULGAR, 2021-04-14 16:09:12

I can not understand what is the problem, writes an error?

Program zl;
var a,b, max: intenger;
begin 
readin (a,b);
if a<b then max:=b;
else max:=a;
 writeln ('max=',max);
 end.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-04-14
@vabka

Are you really kidding me? You have typos there that the compiler is talking about.

source.pas(2,16) Error: Identifier not found "intenger"

Must be Integer
source.pas(4,3) Error: Identifier not found "readin"

Should be readln
source.pas(5,8) Fatal: Syntax error, "THEN" expected but "ELSE" found

if should always have a then branch
The result should be something like this:
Program zl;
var a, b, max: Integer;
begin
  readln(a,b);
  if a < b then
    max := b //Да. Никакой точки с запятой тут быть не должно.
  else
    max := a;
  writeln('max=', max);
end.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question