|
|
back to boardTest 6 Time limit exceeded Pascal Posted by Denuha 26 Feb 2014 01:33 var text: string; flag: boolean; k, i: integer; begin readln(text); flag := true; text := text + ' '; while flag do begin k := 1; for i := 1 to length(text) - 1 do begin if (text[i + 1] = ' ') then break; if (text[i] = text[i + 1]) then begin delete(text, i, 2); k := 0; break; end; end; if k = 0 then flag := true else flag := false; end; for i := 1 to length(text) - 1 do write(text[i]); end. Edited by author 26.02.2014 01:33 Edited by author 26.02.2014 01:34 |
|
|