当前位置:网站首页>参考代码系列_1.各种语言的Hello World
参考代码系列_1.各种语言的Hello World
2022-07-31 04:43:00 【joyyi9】
参考代码系列目录
前言
一、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 )
总结
哈哈哈,无聊而作
边栏推荐
- 三子棋的代码实现
- (6) Enumeration and annotation
- Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
- Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
- Exsl file preview, word file preview web page method
- Open Source Database Innovation in the Digital Economy Era | 2022 Open Atom Global Open Source Summit Database Sub-Forum Successfully Held
- View source and switch mirrors in two ways: npm and nrm
- 行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
- Go语学习笔记 - 处理超时问题 - Context使用 | 从零开始Go语言
- Bubble sort, selection sort, insertion sort, binary search directly
猜你喜欢
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
STM32HAL library modifies Hal_Delay to us-level delay
LocalDate addition and subtraction operations and comparison size
重磅 | 开放原子校源行活动正式启动
The third is the code to achieve
Basic knowledge of mysql (2)
已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined
Learning DAVID Database (1)
pom文件成橘红色未加载的解决方案
Notes on the establishment of the company's official website (6): The public security record of the domain name is carried out and the record number is displayed at the bottom of the web page
随机推荐
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
微软 AI 量化投资平台 Qlib 体验
$attrs/$listeners
产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
PWN ROP
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
[shell basics] determine whether the directory is empty
input输入框展示两位小数之precision
ClickHouse:设置远程连接
"DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction" paper notes
prompt.ml/15中<svg>标签使用解释
扫雷游戏(c语言写)
【py脚本】批量二值化处理图像
BUG destroyer!!Practical debugging skills are super comprehensive
SOLVED: After accidentally uninstalling pip (two ways to manually install pip)
Safety 20220722
MySQL数据库备份
高斯分布及其极大似然估计
MySQL基础操作
Postgresql 15 source code analysis (5) - pg_control