warning C4518: '__int64 ' : storage-class or type specifier(s) unexpected here; ignored
#include<iostream>
using namespace std;
__int64 ttemp=0,ktemp=0;
/*ttemp、ktemp相当于等式中的x,y*/
__int64 exgcd(__int64 a,__int64 b)
{
if(b==0)
{
ktemp=0;
ttemp=1;
return a;
}
__int64 d = exgcd(b,a%b);
__int64 temp =ttemp;
ttemp = ktemp;
ktemp = ttemp - (a/b)* ktemp;
return d;
}
/*
根据题意 设 step 青蛙跳的步数
则有 abs((x + m × t) - (y + n × t)) = k × L ; 成立
则有 (m - n) × t - (y - x ) = k × L;
则有 (m - n ) × t - k × L = (y - x)
所以 令 temp = (m - n),kemp = (y - x),cemp = L;
则原式变为 temp * t + cemp * k = kemp;
即为 a * x + b * y = c;的形式
*/
int main()
{
__int64 a=0,b=0,c=0,
__int64 x=0,y=0,m=0,n=0,l=0;
__int64 gcdValue=0;
scanf("%I64d%I64d%I64d%I64d%I64d",&x,&y,&m,&n,&l);
if(m==n && x != y)
{
printf("Impossible\n");
return 0;
}
if(m > n)
{
a = m-n;
c = y-x;
}
else
{
a = n-m;
c = x-y;
}
gcdValue = exgcd(a,l);
if(m==n || c % gcdValue !=0)
{
printf("Impossible\n");
return 0;
}
printf("%I64d",(c/gcdValue));
return 0;
}
找了一下,原来是_
_int64 a=0,b=0,c=0,
__int64 x=0,y=0,m=0,n=0,l=0;
逗号结尾了,逗号改为分号即可。