vc++初学者的迷惑

来源:百度知道 编辑:UC知道 时间:2024/05/11 02:11:29
#include<iostream>
using namespace std;
void main()
{
int a=0;
cout<<a++<<endl;
cout<<++a<<endl;
int b=10;
cout<<b-<<endl;
cout<<-b<<endl;
cout<<a+++b<<endl;
}
高手查错!!!为什么总是error C2059: syntax error : '<<'
执行 cl.exe 时出错.
谢谢了!!!!

#include<iostream>
using namespace std;
void main()
{
int a=0;
cout<<a++<<endl;
cout<<++a<<endl;
int b=10;
cout<<b--<<endl;
cout<<--b<<endl;
cout<<a+++b<<endl;
}

这个就是对的

cout<<b-<<endl;
cout<<-b<<endl;
cout<<a+++b<<endl;
这些你确定是对的?
b--
--b
a+b
这些换掉那些试试。

b--
--b