var S, word_:string;
max, num:integer;
begin
max:=-2147483648;
readln(S);
S:=S+' ';
while S.Length > 0 do begin
word_ := copy(S, 1, pos(' ', S, 1));
delete(S, 1, pos(' ', S, 1));
if TryStrToInt(word_, num) = true then begin
if num > max then
max:=num;
end;
writeln(num);
end.
Объяснение:
var S, word_:string;
max, num:integer;
begin
max:=-2147483648;
readln(S);
S:=S+' ';
while S.Length > 0 do begin
word_ := copy(S, 1, pos(' ', S, 1));
delete(S, 1, pos(' ', S, 1));
if TryStrToInt(word_, num) = true then begin
if num > max then
max:=num;
end;
end;
writeln(num);
end.
Объяснение: