fork download
  1. program ideone;
  2. uses math;
  3. var
  4. i, j, x, n: Integer;
  5. sum: Real;
  6.  
  7. function Factorial(param: Integer): Integer;
  8. var
  9. Fact: Integer;
  10. begin
  11. Fact := 1;
  12. for i:=2 to param do
  13. Fact := Fact*i;
  14. Factorial := Fact;
  15. end;
  16. begin
  17. n := 3;
  18. sum := 0;
  19. x := 5;
  20. for i:=1 to n do
  21. begin
  22. sum := sum + power(x, i)/factorial(i);
  23. end;
  24. writeln(sum);
  25. end.
Success #stdin #stdout 0s 400KB
stdin
Standard input is empty
stdout
 2.58333333333333E+001