栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

使用6种语言实现打印HelloWorld

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用6种语言实现打印HelloWorld

通过本篇文章,我们可以学到python,javascript, go, rust, java,c 六种编程语言实现打印输出Hello, world!的方式。还能学到编译运行的套路,练习编程手感,挺不错的。

python 实现
print("Hello, world!")
# 解释运行 python3 helloworld.py
  1. 解释运行 python3 helloworld.py
javascript 实现
function main() {
    console.log("Hello, world!");
}
main()

// 解释运行 node helloworld.js
  1. 解释运行 node helloworld.js
rust 实现
fn main() {
    println!("Hello, world!");
}
// 编译 rustc helloworld.rs -o helloworld_rs
// 运行 ./helloworld_rs
  1. 编译 rustc helloworld.rs -o helloworld_rs
  2. 运行 ./helloworld_rs
go 实现
package main

func main() {
	println("Hello, World!")
}

// 运行 go run helloworld.go
// 编译 go build helloworld.go

  1. 解释运行 go run helloworld.go
  2. 编译构建 go build helloworld.go
  3. 运行./helloworld
java 实现
public class helloworld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

// 编译 javac helloworld.java
// 运行 java helloworld
  1. 编译 javac helloworld.java
  2. 运行 java helloworld
c 实现
#include 

int main(){
    puts("Hello, World!");
    return 0;
}
// 编译链接 gcc helloworld.c -o helloworld_c
// 运行 ./helloworld_c
  1. 编译 gcc helloworld.c -o helloworld_c
  2. 运行 ./helloworld_c
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/982016.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号