Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- var d,i,b,n,c,a,j:LongInt;
- begin
- ReadLn(d);
- for i:=1 to d do
- begin
- ReadLn(n);
- a:=1;
- b:=1;
- if n=1 then WriteLn('1')
- else
- if n=2 then WriteLn('1')
- else
- begin
- for j:=3 to n do
- begin
- c:=a+b;
- a:=b;
- b:=c;
- end;
- WriteLn(c);
- end;
- end;
- ReadLn;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement