正文Ubuntu下编辑并编译运行c++程序IP云V管理员/2022-10-01/5 阅读 10/01提示:扫一扫查出行【扫一扫了解最新限行尾号】复制提示一、使用vim编辑c++代码:vim hello.cpp输入如下代码:#include <iostream>using namespace std;int main(){ cout<<"Hello world!"<<endl; return ;}二、编译代码:gcc hello.cpp -lstdc++ -o hello或g++ hello.cpp -o hello三、运行./hello注意:这里是输入"./hello"而不是hello。然后你就能看到屏幕上输出了一个"Hello world!"。