warning C4518: '__int64 ' : storage-class or type specifier(s) unexpected here; ignored
2012-06-03 20:01
916 查看
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;
逗号结尾了,逗号改为分号即可。
#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;
逗号结尾了,逗号改为分号即可。
相关文章推荐
- unexpected 'class***或error C2501: missing storage-class or type specifiers 错误解决办法
- error: #77-D: this declaration has no storage class or type specifier
- this declaration has no storage class or type specifier。。。警告什么意思
- error C2501: 'GetDocument' : missing storage-class or type specifiers 问题的处理
- 'IplImage' : missing storage-class or type specifiers
- 'HDEVNOTIFY' : missing storage-class or type specifiers
- 关于dsound.h的问题error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
- error C2501: '_Application' : missing storage-class or type specifiers
- error C2501: 'AUX_RGBImageRec' : missing storage-class or type specifiers
- error C2501: 'string' : missing storage-class or type specifiers
- The type or namespace name 'Windows' does not exist in the class or namespace 'System'
- 简单的问题,用类创建一个对象error C2380: type(s) preceding 'Complex' (constructor with return type, or illegal redefinition of current class-n
- '_ConnectionPtr' : missing storage-class or type specifiers
- 解决 C++错误 error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString' (or there is no
- The type 'Microsoft.Office.Interop.Excel.ApplicationClass' has no constructors defined
- 错误:A SPI class of type org.apache.lucene.*** with name 'Whitespace' does not exist.
- error: expected constructor, destructor, or type conversion before '(' token问题
- unknown type name 'class' 的解决
- iOS编译错误:Property cannot have array or function type 'Block' (aka 'void (XXXXView *__st
- Bug:Interoptype 'Microsoft.Office.Interop.Excel.WorkbookClass' cannot be embedded. Use theapplicable