这段C++代码有什么问题?

来源:百度知道 编辑:UC知道 时间:2024/06/01 03:33:53
#include<iostream>
using namespace std;
void main()
{
int a,b;
int max;
cout"请输入整数A:";
cin a;
cout"input number:";
cin>>b;
if(a>b)
{
{cout<<"a is big one"<<a<<end1;
}
else{
if a==b)
{
cout<<"a=b"<<end1;
}
else{
cout<<"b is big one"<<end1;
}
}
}
怎么在VS2008中老是报错?

错的都没法看了
你见过这样的语句吗
cout"请输入整数A:";
cin a;
还有其他的呢 endl还是end1呢

#include<iostream>
using namespace std;
void main()
{
int a,b;
int max;
cout<<"请输入整数A:";
cin>>a;
cout<<"input number:";
cin>>b;
if(a>b)
{
cout<<"a is big one"<<a<<endl;
}
else{
if (a==b)
{
cout<<"a=b"<<endl;
}
else{
cout<<"b is big one"<<endl;
}
}
}

ifa==b)少了一边括号,应该改为if(a==b)
end1改为endl你后面那个是数字1.而不是英文字母l.

C和C++不一样。。

cout<<
cin>>
那个箭头符号一定不能丢。
我能看出你是学过C得。如果有C的输入输出也可以的

#include<iostream>
using namespace std;
int main() //要想vs2008不报错。这里必须改成标准形式然后最后返回0
{
int a,b;
int max; //定义的也没用到
cout<<"请输入整数A:";
cin >>a;
cout<&l