im practicing this for school and its not working
my homework is to make a code that counts number of words in sentence but there are 2 spaces or more between words so i can count number of spaces+1
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var s:string;
br,i,a:integer;
begin
readln(s);
br:=0;
for i:=1 to length(s) do
if s=' ' then
begin
while pos(' ',s)+1=' ' do < shows ereor there
begin
a:=0;
a:=pos(' ',s)+1;
delete(s,a,1);
end;
br:=br+1;
end;
br:=br+1;
writeln(br);
readln;
{ TODO -oUser -cConsole Main : Insert code here }
end.