TU-MAX.PASVAR S,S1

2. Tu-max.pas

var s,s1:string;

a:array[1..128]of string;

i,j,max:integer;

begin

readln(s);

while s[1]=#32 do delete(s,1,1);

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)>0 do delete(s,pos(#32#32,s),1);

j:=1;

for i:=1 to length(s) do

begin

if s[i]<>#32 then a[j]:=a[j]+s[i]

else inc(j);

end;

max:=length(a[1]);

for i:=1 to j do

if length(a[i])>max then max:=length(a[i]);

writeln('(cac) tu dai nhat: (co ',max,' ky tu:)');

if length(a[i])=max then writeln(a[i]);

readln;

end.