mkdir temp
cd temp
1)C程序
gedit testc.c
#include<stdio.h> int main() { printf("Hello World!\n"); return 0; }
gcc testc.c -o hello
./hello
Hello World!
2)C++程序
gedit test.cpp
#include<iostream> int main(){ std::cout<<"Hello, world!\n"; }
g++ test.cpp -o test
./test
Hello, world!