当前位置:网站首页>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慢查询的原因分析
- On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
- Unity资源管理系列:Unity 框架如何做好资源管理
- SQL statement to range query time field
- The Vue project connects to the MySQL database through node and implements addition, deletion, modification and query operations
- 重磅 | 基金会为白金、黄金、白银捐赠人授牌
- 专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
- MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
- ENSP, VLAN division, static routing, comprehensive configuration of Layer 3 switches
- DVWA之SQL注入
猜你喜欢
STM32 - DMA
从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
DVWA shooting range environment construction
STM32HAL库修改Hal_Delay为us级延时
MySQL事务(transaction) (有这篇就足够了..)
[Linear Neural Network] softmax regression
Fusion Cloud Native, Empowering New Milestones | 2022 Open Atom Global Open Source Summit Cloud Native Sub-Forum Successfully Held
MySQL optimization slow log query
From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
MySQL开窗函数
随机推荐
SQL row-column conversion
MySQL忘记密码怎么办
Hand in hand to realize the picture preview plug-in (3)
打造基于ILRuntime热更新的组件化开发
Unity框架设计系列:Unity 如何设计网络框架
简易网络文件拷贝的C实现
MySQL优化之慢日志查询
STM32——DMA
Doris学习笔记之监控
30 Years of Open Source Community | 2022 Open Atom Global Open Source Summit 30 Years of Open Source Community Special Event Held Successfully
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
DVWA安装教程(懂你的不懂·详细)
sql statement - how to query data in another table based on the data in one table
Unity Fighter
PWN ROP
【线性神经网络】softmax回归
MySQL数据库必会的增删查改操作(CRUD)
STM32HAL库修改Hal_Delay为us级延时
Centos7 install mysql5.7 steps (graphical version)
View source and switch mirrors in two ways: npm and nrm