Câu a)
Program BTT;
Uses crt;
Var i,s: longint;
Begin
Clrscr;
s:=0;
i:=0;
While s<1000 do
Begin
i:=i+2;
If s<1000 then
s:=s+i;
If s>=1000 then
Begin
s:=s-i;
Break;
End;
End;
Write('S = ',s);
Readln
End.
Câu e)
Program BTT;
Uses crt;
Var i,s: longint;
Begin
Clrscr;
s:=0;
i:=0;
While s<1000 do
Begin
i:=i+2;
If s<1000 then
s:=s+i;
If s>=1000 then
Begin
s:=s-i;
Break;
End;
End;
Write('So = ',i+1);
Readln
End.