当前位置:网站首页>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
边栏推荐
- Open Source Smart Future | 2022 OpenAtom Global Open Source Summit OpenAtom openEuler sub-forum was successfully held
- sql语句-如何以一个表中的数据为条件据查询另一个表中的数据
- Unity URP渲染管线摄像机核心机制剖析
- MySQL transaction isolation level, rounding
- mysql uses on duplicate key update to update data in batches
- Unity资源管理系列:Unity 框架如何做好资源管理
- Musk talks to the "virtual version" of Musk, how far is the brain-computer interaction technology from us
- Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
- Vue项目通过node连接MySQL数据库并实现增删改查操作
- 开源汇智创未来 | 2022开放原子全球开源峰会OpenAtom openEuler分论坛圆满召开
猜你喜欢

Mysql应用安装后找不到my.ini文件

Numpy中np.meshgrid的简单用法示例

WeChat applet uses cloud functions to update and add cloud database nested array elements

MySQL事务隔离级别详解

Mysql application cannot find my.ini file after installation

MySQL database backup

MySQL database installation (detailed)

开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)

Explanation of
随机推荐
MySQL常见面试题汇总(建议收藏!!!)
Blockbuster | foundation for platinum, gold, silver gave nameboards donors
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)Solution
Unity教程:URP渲染管线实战教程系列【1】
On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
Unity URP渲染管线摄像机核心机制剖析
Unity框架设计系列:Unity 如何设计网络框架
Unity shader forge和自带的shader graph,有哪些优缺点?
PWN ROP
扫雷小游戏——C语言
益智类游戏关卡设计:逆推法--巧解益智类游戏关卡设计
Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
STM32 - DMA
打造基于ILRuntime热更新的组件化开发
Lua,ILRuntime, HybridCLR(wolong)/huatuo热更新对比分析
Unity资源管理系列:Unity 框架如何做好资源管理
Minesweeper game (written in c language)
[Linear Neural Network] softmax regression
Lua,ILRuntime, HybridCLR(wolong)/huatuo hot update comparative analysis
MySQL事务(transaction) (有这篇就足够了..)