当前位置:网站首页>Reference code series_1. Hello World in various languages
Reference code series_1. Hello World in various languages
2022-07-31 04:56:00 【joyyi9】
Refer to the Code Series Catalog
各种语言的Hello World
前言
一、Js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello World</title>
<script>
function displayDate({
document.getElementById("demo").innerHTML=Date();}
</script>
</head>
<body>
<h1>Hello World</h1>
<p id="demo">xxx</p>
<button type="button" onclick="displayDate()">显示日期</button>
</body>
</html>
二、Python
print("Hello, World!")
三、Java
public class HelloWorld {
public static void main(String []args) {
System.out.println("Hello World");
}
}
四、C
#include <stdio.h>
int main()
{
/* 我的第一个 C 程序 */
printf("Hello, World! \n");
return 0;
}
五、C++
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!" << endl;
cout << "Hello, world!" << "\n";
return 0;
}
六、Ruby
puts "Hello World!";
七、Scala
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
八、Go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
九、C#
using System;
namespace HelloWorldApplication
{
/* 类名为 HelloWorld */
class HelloWorld
{
/* main函数 */
static void Main(string[] args)
{
/* 我的第一个 C# 程序 */
Console.WriteLine("Hello World!");
Console.ReadKey();
}
}
}
十、R
myString <- "Hello, World!"
print ( myString )
总结
哈哈哈,bored
边栏推荐
- 12个MySQL慢查询的原因分析
- Unity URP渲染管线摄像机核心机制剖析
- 【线性神经网络】softmax回归
- visual studio 那些提高效率的快捷键,总结(不时更新)
- npm、nrm两种方式查看源和切换镜像
- [py script] batch binarization processing images
- Puzzle Game Level Design: Reverse Method--Explaining Puzzle Game Level Design
- Go语学习笔记 - 处理超时问题 - Context使用 | 从零开始Go语言
- 【debug锦集】Expected input batch_size (1) to match target batch_size (0)
- 产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
猜你喜欢

益智类游戏关卡设计:逆推法--巧解益智类游戏关卡设计

Unity Framework Design Series: How Unity Designs Network Frameworks

12个MySQL慢查询的原因分析

MySQL常见面试题汇总(建议收藏!!!)

centos7安装mysql5.7步骤(图解版)

On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held

Heavyweight | The Open Atomic School Source Line activity was officially launched

The input input box displays the precision of two decimal places

开源汇智创未来 | 2022开放原子全球开源峰会OpenAtom openEuler分论坛圆满召开

城市内涝及桥洞隧道积水在线监测系统
随机推荐
A complete introduction to JSqlParse of Sql parsing and conversion
SOLVED: After accidentally uninstalling pip (two ways to manually install pip)
Multiple table query of sql statement
CentOS7 —— yum安装mysql
Gaussian distribution and its maximum likelihood estimation
Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
PWN ROP
SQL语句中对时间字段进行区间查询
论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开
Puzzle Game Level Design: Reverse Method--Explaining Puzzle Game Level Design
ERP Production Operation Control Kingdee
Three oj questions on leetcode
HCIP Day 10_BGP Route Summary Experiment
XSS靶场(三)prompt to win
MySQL transaction isolation level, rounding
Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
Musk talks to the "virtual version" of Musk, how far is the brain-computer interaction technology from us
unity2d game
Unity打灵狐者
npm、nrm两种方式查看源和切换镜像