题目: |
program exp4;
var
p,e:array[1..100] of longint;
n,i,m,ans:longint;
function pow(x,w:longint):longint;
var
i,ret:longint;
begin
ret:=1;
for i:=1 to w do
ret:=ret*x;
exit(ret);
end;
begin
readln(n);
m:=0; i:=2;
while n<>1 do
begin
if n mod i = 0 then
begin
inc(m);
p[m]:=i;
e[m]:=0;
while n mod i = 0 do
begin
inc(e[m]);
n:=n div i;
end;
end;
inc(i);
end;
ans:=1;
for i:=1 to m do
ans:=ans*(p[i]-1)*pow(p[i],e[i]-1);
writeln(ans);
end.
输入:19800 输出:4800
|