下面是我的一段程序int main(){int a=0;cout<<"please input a number."<<endl;cin>>a;if(a=1){cout<<"the variable is 1.";}else{cout&l... 展开
下面是我的一段程序int main(){int a=0;cout<<"please input a number."<<endl;cin>>a;if(a=1){cout<<"the variable is 1.";}else{cout<<"sorry.";}}这段程序中的if语句有问题,我不知道为什么就是无法让他执行else语句也就是,无论你输入什么数字它都输出“the variable is 1.”.是什么原因使得它无法显示,也没有错误。 收起