1、安装vim 和 gcc工具
[root@localhost soucecode]# yum install vim [root@localhost soucecode]# yum install gcc
2、编写程序
[root@localhost soucecode]# cat test. test.c test.out [root@localhost soucecode]# cat test.c #includeint main(){ printf("Hello World"); }
3、编译+运行
[root@localhost soucecode]# gcc test.c -o test.out [root@localhost soucecode]# ls test.c test.out [root@localhost soucecode]# ./test.out Hello World二、C++程序
1、安装gcc++工具
[root@localhost soucecode]# yum install gcc-c++
2、编写程序
[root@localhost soucecode]# cat test2.cpp #includeusing namespace std; int main() { cout << "Hello, world!" << endl; return 0; }
3、编译+运行
[root@localhost soucecode]# g++ test2.cpp -o test2 [root@localhost soucecode]# ls test2 test2.cpp test.c test.out [root@localhost soucecode]# ./test2 Hello, world!三、Python程序
Python为解释性程序,无需编译。
1、编写程序
[root@localhost soucecode]# cat test3.py print("Hello, World")
2、运行
[root@localhost soucecode]# python test3.py Hello, World