各种语言的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 )

总结

哈哈哈,无聊而作

posted @   cactus9  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示