pascal斐波那契数列 要用repeat语句做求数列:1,1,2,3,5,8,13,21,34,55,……的第n项的值.

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 01:58:32
pascal斐波那契数列 要用repeat语句做求数列:1,1,2,3,5,8,13,21,34,55,……的第n项的值.
x)+H,NNy6m³͋^6-~t⳩vLWxE%/֯}ڿig 21111ձ14121615y԰ jyfM˅; {lI + lŲ"0SSSSlWZd HJM̃*)JMLӴ TXؕHb+[#k&*+ Jk8hhHQ 4$3G6&P^YQU <;PHf

pascal斐波那契数列 要用repeat语句做求数列:1,1,2,3,5,8,13,21,34,55,……的第n项的值.
pascal斐波那契数列 要用repeat语句做
求数列:1,1,2,3,5,8,13,21,34,55,……的第n项的值.

pascal斐波那契数列 要用repeat语句做求数列:1,1,2,3,5,8,13,21,34,55,……的第n项的值.
var
n,x,y,z,s:integer;
begin
readln(n);
x:=1;
y:=1;
s:=2;
repeat
z:=x+y;
x:=y;
y:=z;
inc(s);
until s=n;
write(z);
end.