我在我的代码得到这个错误在编译 这里是代码错误:左值要求作为分配的左操作数,我得到这个错误是什么左值和右值,以及如何消除这种错误
#include <iostream>
using namespace std;
int main()
{
int l,n,w,h;
cin>>l>>n;
while(n--){
cin>>w>>h;
if(w>l||h>l)
cout<<"CROP IT"<<endl;
if(w==l&&h==l&&w=h)
cout<<"ACCEPTED"<<endl;
if(w<l||h<l)
cout<<"UPLOAD ANOTHER"<<endl;
}
}
和错误
11:22: error: lvalue required as left operand of assignment
这是一个重复的问题。请参阅:http://stackoverflow.com/questions/19973320/error-lvalue-required-as-left-operand-of-assignment-c – Sampath
使用空格键会使原因更容易被发现。 – molbdnilo