Advertisement
klasscho

Untitled

Feb 22nd, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function LongestWord(var Words: String) : TLine;
  2.  
  3. Var
  4. i, j, k, Max: Integer;
  5. Line: TLine;
  6. begin
  7. i := 1;
  8. repeat
  9. j := 0;
  10. while (Words[i] <> ' ') and (i <= length(Words)) Do Begin
  11. Line[j] := Line[j] + Words[i];
  12. Inc(i);
  13. end;
  14. if length(Line) = Max then
  15. Writeln(Line[j]);
  16. Line[j] := '';
  17. Inc(j);
  18. until i > length(Words);
  19. LongestWord := Line;
  20. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement