编写一个C++程序分为4步:
- 创建项目
- 创建文件
- 编写代码
- 运行程序
1.创建项目
Visual Studio是我们用来编写C++程序的主要工具,我们先将它打开
2.创建文件
鼠标右键源文件,选择添加->新建项
3.编写代码
#include<iostream>
using namespace std;
int main(){
cout << "Hello World" << endl;
system("pause");
return 0;
}
4.运行程序