/* 最大公约数 */
int gcd(int a,int b)
{
int tmp;
if( a*b == 0 ){
perror(" either a or b is zero.");
return 0;
}
if( a < b ){
tmp=a;
a=b;
b=tmp;
}
while( a % b ){
tmp=a;
a=b;
b=tmp%b;
}
/* 最大公约数 */
int gcd(int a,int b)
{
int tmp;
if( a*b == 0 ){
perror(" either a or b is zero.");
return 0;
}
if( a < b ){
tmp=a;
a=b;
b=tmp;
}
while( a % b ){
tmp=a;
a=b;
b=tmp%b;
}
return b;
}