你的代码没有问题,估计是编译器问题,或者你创建工程、文件的时候不正确。
文件扩展名应该 是.CPP, 不能是.C。
#include
using namespace std;
void main(void)
{
cout << "Hello!\n";
cout << "Welcome to c++!" << endl;
cout << "This is my first c++ program" << endl;
}
你好
在我电脑上运行的结果没错误
估计是你新建工作空间和源文件出了问题?是不是选点错了
#include
using namespace std;