//
Source?Code
//
common?divisor最大公約數
inline?unsigned?
int
?cd(unsigned?
int
?x,unsigned?
int
?y)???
?
{???
????unsigned?
int
?i,j,t;???
????
if
(x
==
0
)?
return
?y;???
????
if
(y
==
0
)?
return
?x;???
????
for
(i
=
0
;
0
==
(x
&
1
);x
>>=
1
,
++
i);???
????
for
(j
=
0
;
0
==
(y
&
1
);y
>>=
1
,
++
j);???
????
if
(j
<
i)?i
=
j;???
????
for
(;;)???
????
{???
????????
if
(x
<
y)?t
=
y,y
=
x,x
=
t;???
????????
if
(
0
==
(x
-=
y))?
return
?y
<<
i;???
????????
for
(;
0
==
(x
&
1
);x
>>=
1
);???
????}
???
}
?


