[pascal highlight=“6,27,28,31,32,33,34,35”] //fib2.pas const MAXLEN=6000; type high=array[0..MAXLEN]of longint; var n,i:longint; a,b,c:high; f1,f2,f3,bak:^high; procedure plus(var c,a,b:high); var larger,x,i:longint; begin fillchar(c,sizeof(c),0); if a[0]>b[0] then larger:=a[0] else larger:=b[0]; x:=0; for i:=1 to larger do begin x:=a[i]+b[i]+x div 10000; c[i]:=x mod 10000; end; if x>=10000 then begin c[larger+1]:=1; c[0]:=larger+1; end else c[0]:=larger; end; begin assign(input,‘fib.in’);reset(input); assign(output,‘fib.out’);rewrite(output); fillchar(a,sizeof(a),0); fillchar(b,sizeof(b),0); f1:=@a;f2:=@b;f3:=@c; f3[0]:=1;f3[1]:=1; readln(n); for i:=2 to n do begin bak:=f1; f1:=f2; f2:=f3; f3:=bak; plus(f3,f1,f2^); end; write(f31:4); for i:=f32-1 downto 1 do begin if f33<10 then write(‘000’) else if f34<100 then write(‘00’) else if f35<1000 then write(‘0’); write(f36); if (f37-i+1)mod 10=0 then writeln; end; close(input);close(output); end.