Var Q,w, a,b,h, S: real; Begin WriteLn('Q(w) = 31w+31'); Write('a = ');ReadLn(a); Write('b = ');ReadLn(b); Write('h = ');ReadLn(h); S := 0; w := a; if (a < b) then begin if (h < 0) then exit; end else if (a > b) then if (h > 0) then exit;
While (w <= b) do begin Q := 31*w+31; if (Q < 0 ) then S := S + Q; w := w + h; end; WriteLn('S = ',S); End.
Var
Q,w, a,b,h, S: real;
Begin
WriteLn('Q(w) = 31w+31');
Write('a = ');ReadLn(a);
Write('b = ');ReadLn(b);
Write('h = ');ReadLn(h);
S := 0;
w := a;
if (a < b) then
begin
if (h < 0) then exit;
end
else if (a > b) then
if (h > 0) then exit;
While (w <= b) do
begin
Q := 31*w+31;
if (Q < 0 ) then
S := S + Q;
w := w + h;
end;
WriteLn('S = ',S);
End.