tw9919.pp 298 B

123456789101112131415161718192021
  1. type
  2. TForm1 = class
  3. function crash(n:integer):real;
  4. end;
  5. function TForm1.crash(n:integer):real;
  6. begin
  7. case n of
  8. 0: Result:=0;
  9. 1..100: Result:=crash(n-1)+crash(n-1);
  10. end;
  11. end;
  12. var
  13. f : TForm1;
  14. begin
  15. f:=TForm1.create;
  16. writeln(f.crash(15));
  17. f.Free;
  18. end.