Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function LongestWord(var Words: String) : TLine;
- Var
- i, j, k, Max: Integer;
- Line: TLine;
- begin
- i := 1;
- repeat
- j := 0;
- while (Words[i] <> ' ') and (i <= length(Words)) Do Begin
- Line[j] := Line[j] + Words[i];
- Inc(i);
- end;
- if length(Line) = Max then
- Writeln(Line[j]);
- Line[j] := '';
- Inc(j);
- until i > length(Words);
- LongestWord := Line;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement