PersonalCorpus 版 (精华区)

2454 2002-10-11 16:04:29 BigGuava
102 .PAS Accepted 63 ms 12 kb

var i,j,k:integer;

function gcd( a,b:integer ):integer;
begin
    if b=0 then gcd:=a else gcd:=gcd(b,a mod b)
end;

begin
    readln(j);
    k:=1;
    for i:=2 to j-1 do if gcd(i,j)=1 then inc(k);
    writeln(k);
end.
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.035毫秒