Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

{$N+}

var

x : longint;

y : extended;

temp1, temp2 : longint;

i : longint;

function exponent(number, exp : longint) : longint;

var

count, temp : longint;

begin

temp := 1;

for count := 1 to exp do

temp := temp * number;

exponent := temp;

end;

function factorial(number : longint) : longint;

var

temp : longint;

begin

if number = 1 then

temp := number

else

temp := number * factorial(number - 1);

factorial := temp;

end;

{

begin

for i := 1 to 6 do

writeln(factorial(i));

for i := 1 to 6 do

writeln(exponent(6, i));

end.

}

begin

x := 12;

temp1 := 1 - exponent(x, 2) div factorial(2) + exponent(x, 4) div factorial(4);

temp2 := exponent(x, 6) div factorial(6) + exponent(x, 8) div factorial(8) + exponent(x, 10) div factorial(10);

y := temp1 + temp2;

writeln(y);

end.

You'll need a floating point chip to compile this. Most 486 and Pentium chips will do this.