- 论坛徽章:
- 0
|
刚在学习中,菜鸟请教:
//Compute two integer's sum
#include <iostream>
using namespace std;
main()
{int a,b;
int sum;
cout<<"please enter one integer:"<<a<<endl;
cin>>a>>endl;
cout<<"please enter another integer:"<<b<<endl;
cin>>b>>endl;
sum=a+b;
cout<<"sum of the two integer is:"<<sum<<endl;
system("pause");
return 0;
}
为什么加上红色那两个“endl”就编译不过去呢?去掉则可以:shock:
visual c++6.0编译失败,Dev C++ 5也是
D:\VC++\sum.cpp(9) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion)
[ 本帖最后由 灵犀一指 于 2008-2-21 14:24 编辑 ] |
|