Через Repeat :
Var i, s:Integer ;
Begin
I:=1;s:=0;
Write(' Введите последовательность чисел') ;
Repeat
Read(i) ;
If (i>0)and(i<20)then s:=s+i;
Until i=0;
Writeln;write(s) ;
End.
Через While
Var i, s:Integer ;
Begin
I:=1;s:=0;
Write(' Введите последовательность чисел') ;
While i<>0 do begin
Read(i) ;
If (i>0)and(i<20) then s:=s+i;
End;
Writeln;write(s) ;
End.