Skip to content

Instantly share code, notes, and snippets.

@Eric-Bro
Created March 15, 2012 03:11
Show Gist options
  • Save Eric-Bro/2041628 to your computer and use it in GitHub Desktop.
Save Eric-Bro/2041628 to your computer and use it in GitHub Desktop.
var i,k: integer;
a: array [1..10] of string;
s: string;
begin
readln(s);
k:=1;
for i:= 1 to length(s) do
if (s[i]<> ' ') then a[k]:= a[k] + s[i]
else if (a[k] <> '') then inc(k);
if (a[k] = ' ') then dec(k);
for i:=1 to k do
writeln(a[i]);
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment