- C
int main() {
printf("Hello World");
return 0;
}
$ gcc -o test test.c
$ ./test
- C++
using namespace std;
int main() {
cout << "Hello World";
return 0;
}
$ g++ -o test test.c
$ ./test
- PERL
print "Hello World!\n";
$ perl test.pl
- PYTHON
print(os.sys.path)
$ python test.py
或
$ python3 test.py
- JAVA
{
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
$ javac HelloWorld.java
$ java -classpath . HelloWorld
- GO - https://golang.org ( 安装 )
$ mkdir hello && cd hello
$ gedit hello.go
$ gedit hello.go
package main
import "fmt"
func main() {
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
$ go build
$ ./hello
没有评论:
发表评论