Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program taskThreePointOne;
- uses SysUtils;
- var
- words: array[1..10] of string;
- camelCase, theWord: string;
- position, wordPointer: integer;
- endOfSentence: boolean;
- begin
- position := 1;
- wordPointer := 1;
- endOfSentence := false;
- theWord := '';
- writeln('Please enter the Camel Case text: ');
- readln(camelCase);
- while NOT endOfSentence do
- begin
- if camelCase[position] = UpperCase(camelCase[position]) then
- begin
- if NOT (theWord = '') then
- begin
- words[wordPointer] := theWord;
- wordPointer := wordPointer + 1;
- end;
- theWord := camelCase[position];
- end
- else
- begin
- theWord := theWord + camelCase[position];
- end;
- if (position = length(camelCase)) then
- begin
- words[wordPointer] := theWord;
- wordPointer := wordPointer + 1;
- endOfSentence := true;
- end;
- position := position + 1;
- end;
- for position := wordPointer to 10 do
- words[position] := '(Empty)';
- for position := 1 to 10 do
- writeln(words[position]);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement