|
Python 3.x- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Hello, world!" << endl;
- return 0;
- }
复制代码 C++
- public class HelloWorld {
- public static void main(String[] args) {
- System.out.println("Hello World");
- }
- }
复制代码 Java
Ruby
Perl- package main
- import "fmt"
- func main() {
- fmt.Println("Hello, World!")
- }
复制代码 Go- fn main() {
- println!("Hello World!");
- }
复制代码 Rust- object HelloWorld {
- def main(args: Array[String]): Unit = {
- println("Hello, world!")
- }
- }
复制代码 Scala好像没缩进
来源:菜鸟教程 - 学的不仅是技术,更是梦想! (runoob.com)
|
|