# include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
$ gcc -o test test.c
$ ./test
#include <iostream>
using namespace std;
int main() {
cout << "Hello World";
return 0;
}
$ g++ -o test test.c
$ ./test
#!/usr/bin/perl
print "Hello World!\n";
$ perl test.pl
import os
print(os.sys.path)
$ python test.py
或
$ python3 test.py
public class HelloWorld
{
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
$ javac HelloWorld.java
$ java -classpath . HelloWorld
$ mkdir hello && cd hello
$ gedit hello.go
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
$ go build
$ ./hello