360mini路由器怎么样:C++编程问题,请各大吓指导~~
来源:百度文库 编辑:高校问答 时间:2024/05/03 00:11:32
#include <iostream.h>
void main()
{
int a=1,b=2,c=3;
int d,e;
d=a^b&-c;
e=-a|a;
cout<<d<<endl;
cout<<e<<endl;
}
C++的程序~我在纸上计算是“d=3”、“e=(11111111)二进制”,但为什么运行时是“d=1;e=-1”?
void main()
{
int a=1,b=2,c=3;
int d,e;
d=a^b&-c;
e=-a|a;
cout<<d<<endl;
cout<<e<<endl;
}
C++的程序~我在纸上计算是“d=3”、“e=(11111111)二进制”,但为什么运行时是“d=1;e=-1”?
我觉得你的d,e应该定义long int