Program PR1; uses crt; var stroka,tmp:string; i,b,max:integer; Begin clrscr; readln(stroka); max:=0; for i:=1 to length(stroka) do if (stroka[i]=' ') or (stroka[i]='.') then begin if length(tmp)>max then max:=length(tmp); tmp:=''; end else begin tmp:=tmp+stroka[i]; if i=length(stroka) then if length(tmp)>max then max:=length(tmp); end; writeln(max); end.
Answers & Comments
Program PR1;
uses crt;
var stroka,tmp:string;
i,b,max:integer;
Begin
clrscr;
readln(stroka);
max:=0;
for i:=1 to length(stroka) do if (stroka[i]=' ') or (stroka[i]='.') then begin
if length(tmp)>max then max:=length(tmp);
tmp:='';
end
else begin
tmp:=tmp+stroka[i];
if i=length(stroka) then if length(tmp)>max then max:=length(tmp);
end;
writeln(max);
end.