Skip to content

Instantly share code, notes, and snippets.

@Eric-Bro
Created December 1, 2011 04:08
Show Gist options
  • Save Eric-Bro/1413497 to your computer and use it in GitHub Desktop.
Save Eric-Bro/1413497 to your computer and use it in GitHub Desktop.
//For-33
var n, i, tmp_1, tmp_2, fibnumer, should_break: integer;
begin
readln(n);
tmp_1:=1; tmp_2:=1;
if (n=1) then begin writeln(1); should_break:=1; end;
if (n=2) then begin write(1,' ', 1);; should_break:=1; end;
if (should_break <> 1) then
for i:=3 to n do
begin
fibnumber:= tmp_1 + tmp_2;
write(' ',fibnumber);
tmp_1:= tmp_2;
tmp_2:= fibnumber;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment