不可思议的结果
代码如下#include<iostream>
using namespace std;
main()
{
int a=1,b=3;
if(a = b)
cout<<"yes";
else
cout<<"no";
}
竟然输出“yes”
哪为帮忙说明一下理由
2005-12-24 17:46

2005-12-24 18:07
楼上错了,if(a = b)
只要b 不等0条件就为真,并不是能赋值就为真,如果B等0,能赋值条件也为假

2005-12-25 10:07