while not eof(inputFile) do begin readln(inputFile, line); i := 1; while i <= length(line) do begin word := ''; while (i <= length(line)) and (line[i] <> ' ') do begin word := word + line[i]; i := i + 1; end; if length(word) <= 3 then begin write(outputFile, 'в '); end else begin write(outputFile, word + ' '); end; i := i + 1; end; writeln(outputFile); end;
var
inputFile, outputFile: Text;
word: string;
i, j: integer;
line: string;
begin
Assign(inputFile, 'input.txt');
Reset(inputFile);
Assign(outputFile, 'output.txt');
Rewrite(outputFile);
while not eof(inputFile) do
begin
readln(inputFile, line);
i := 1;
while i <= length(line) do
begin
word := '';
while (i <= length(line)) and (line[i] <> ' ') do
begin
word := word + line[i];
i := i + 1;
end;
if length(word) <= 3 then
begin
write(outputFile, 'в ');
end
else
begin
write(outputFile, word + ' ');
end;
i := i + 1;
end;
writeln(outputFile);
end;
Close(inputFile);
Close(outputFile);
end.