{Saravannan Shaan, Woburn CI, Junior Division, Contest 2} uses crt; var count,z,x,i:integer; str:string; curr:char; begin clrscr; for z:=1 to 5 do begin writeln('Enter the string to be encoded'); readln(str); writeln; x:=length(str); count:=1; curr:=str[1]; if x>=2 then begin for i:=2 to x do begin if str[i]=curr then count:=count+1 else begin write(count,curr); count:=1; curr:=str[i]; end; end; write(count,curr); end; if x=1 then write('1',str); writeln; end; readln; end