//for Var x:integer; begin for x:=-3 to 8 do begin; if x>5 then writeln('y=(',x,')',18*x); if (2<=x) and (x<=5) then writeln('y=(',x,')',9*x+10); if x<2 then writeln('y=(',x,')',-12*x); end; end.
//while
Var x:integer; begin x:=-3; while x<>9 do begin; if x>5 then writeln('y=(',x,')',18*x); if (2<=x) and (x<=5) then writeln('y=(',x,')',9*x+10); if x<2 then writeln('y=(',x,')',-12*x); inc(x); end; end.
//repeat Var x:integer; begin x:=-3; repeat if x>5 then writeln('y=(',x,')',18*x); if (2<=x) and (x<=5) then writeln('y=(',x,')',9*x+10); if x<2 then writeln('y=(',x,')',-12*x); inc(x); until x=9; end.
Answers & Comments
Verified answer
//Pascal ABC.NET v3.0 сборка 1111//for
Var
x:integer;
begin
for x:=-3 to 8 do
begin;
if x>5 then writeln('y=(',x,')',18*x);
if (2<=x) and (x<=5) then writeln('y=(',x,')',9*x+10);
if x<2 then writeln('y=(',x,')',-12*x);
end;
end.
//while
Var
x:integer;
begin
x:=-3;
while x<>9 do
begin;
if x>5 then writeln('y=(',x,')',18*x);
if (2<=x) and (x<=5) then writeln('y=(',x,')',9*x+10);
if x<2 then writeln('y=(',x,')',-12*x);
inc(x);
end;
end.
//repeat
Var
x:integer;
begin
x:=-3;
repeat
if x>5 then writeln('y=(',x,')',18*x);
if (2<=x) and (x<=5) then writeln('y=(',x,')',9*x+10);
if x<2 then writeln('y=(',x,')',-12*x);
inc(x);
until x=9;
end.