当前位置:网站首页>参考代码系列_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 )
总结
哈哈哈,无聊而作
边栏推荐
- el-image tag doesn't work after binding click event
- BUG消灭者!!实用调试技巧超全整理
- "A daily practice, happy water problem" 1331. Array serial number conversion
- MySQL模糊查询可以使用INSTR替代LIKE
- The third is the code to achieve
- mysql数据库安装(详细)
- 问题7:列表的拼接
- 专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
- Port inspection steps - 7680 port analysis - Dosvc service
- Exsl file preview, word file preview web page method
猜你喜欢

mysql基础知识(二)

手把手实现图片预览插件(三)

MySQL数据库备份

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

数字经济时代的开源数据库创新 | 2022开放原子全球开源峰会数据库分论坛圆满召开

Hand in hand to realize the picture preview plug-in (3)

已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined

C language confession code?

产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开

MySQL基础操作
随机推荐
【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
ENSP,划分VLAN、静态路由,三层交换机综合配置
HCIP Day 10_BGP Route Summary Experiment
重磅 | 基金会为白金、黄金、白银捐赠人授牌
binom二项分布,
高斯分布及其极大似然估计
已解决:不小心卸载pip后(手动安装pip的两种方式)
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
WPF WPF 】 【 the depth resolution of the template
STM32HAL库修改Hal_Delay为us级延时
mysql数据库安装(详细)
Musk talks to the "virtual version" of Musk, how far is the brain-computer interaction technology from us
30 Years of Open Source Community | 2022 Open Atom Global Open Source Summit 30 Years of Open Source Community Special Event Held Successfully
How Zotero removes auto-generated tags
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
ERP生产作业控制 金蝶
C language confession code?
Safety 20220722