Advertisement
dzieciol

ciąg fibonacciego

Mar 16th, 2015
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.26 KB | None | 0 0
  1.  program funkcja;
  2.  uses crt;
  3.  var
  4.  a,i,b,c,d: integer;
  5.  nww:real;
  6.  
  7.  begin
  8.  b:=1;
  9.  writeln('podaj a');
  10.   readln(d);
  11.   a:=1;
  12.   b:=1 ;
  13.  for i:=2 to d do begin
  14.  c:=a+b;
  15.  a:=b;
  16.  b:=c
  17.     end;
  18.  
  19.   writeln(c);
  20.  
  21.  
  22.    repeat until keypressed;
  23.   end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement