(Gast)
n/a Beiträge
|
Re: Mathe Problem 1+2-3 ... +99-100
7. Jun 2005, 16:44
So könnts gehen:
Delphi-Quellcode:
var
Num, i: Integer;
b: Boolean;
Num := 1;
b := True;
for i := 2 to 100 do
begin
if b then
Num := Num + i
else
Num := Num - i;
b := not b;
end;
|
|
Zitat
|