| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
请教,关于扩展欧几里德的负数运算的问题__int64 x,y,t;
__int64 extend_gcd(__int64 a,__int64 b)
{
__int64 z;
if (!b)
{
x=1;
y=0;
return a;
}
z=extend_gcd(b,a%b);
t=x;
x=y;
y=t-(a/b)*y;
return z;
}
传递参数时候,我传入一正一负,不停WA;保证两个都是正数才AC。
怎样修改才能让传入参数是负数时候也不影响运算结果?
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator