下面一段比较两个数大小的程序,不管我输入的是什么数字,总是输出x=y,想不明白哪里错了#include using namespace std;int main(){int x,y;coutx>>y;if (x=y)cout

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/25 23:50:56

下面一段比较两个数大小的程序,不管我输入的是什么数字,总是输出x=y,想不明白哪里错了
#include
using namespace std;
int main(){
int x,y;
coutx>>y;
if (x=y)
cout

x=y在C语言里表示把y的值给x
改成x==y,试试