c 编程语言hello word,500+种编程语言写的“hello world”你见过么?

d719221b650709d9acc738d52b570328.png

几乎每个程序员写出来的第一个程序都是“hello world”,Hello World最早是由 Brian Kernighan 创建的。1978年,Brian Kernighan写了一本名叫《C程序设计语言》的编程书,在程序员中广为流传。他在这本书中第一次引用的Hello World程序:

main (){  extrn a,b,c;  putchar (a); putchar (b); putchar (c); putchar ('!*n');  }  a 'hell';  b 'o, w';  c 'orld';

之后“Hello world”就开始流行起来,并成为了计算机发展历史上一个具有重要意义的里程碑。

最近猿妹在GitHub上发现了一个十分有趣的开源项目,它汇集了500多种编程语言编写的“Hello world”程序。

a35b30b937badc3947db5b9b52bc8adf.png

这个项目名称就叫hello-world,目前已经获得3241个Star,959个Fork(GitHub地址:https://github.com/leachim6/hello-world),下面我们先看几个过过瘾:

Ada:

with Text_IO;procedure Hello_World is    begin        Text_IO.Put_line("Hello World!");    end Hello_World;

Android:

package com.example.helloworld;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloWorld extends Activity{   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState){       super.onCreate(savedInstanceState);       TextView tv = new TextView(this);       tv.setText("Hello, World");       setContentView(tv);   }}

Bash:

#!/bin/bashecho "Hello World!"

Basic:

10 REM Hello World in BASIC20 PRINT "Hello World"

C++:

#include  // include APIusing namespace std;int main() // the main code portion of a C++ program{   cout <

Caml:

print_endline "Hello world!";;

Delphi:

program HelloWorld;{$APPTYPE CONSOLE}begin    WriteLn('Hello World');end.

Dart:

main() {  print('Hello, World!');}

Elixir:

#!/usr/bin/env elixirIO.puts "Hello world"

erlang_escript:

#!/usr/bin/env escriptmain(_) ->    io:format("Hello World~n").

Factor:

USING: io ;"Hello World" print

Focal:

0.1.0.1 TYPE "HELLO WORLD" , !

Go:

package mainfunc main() {  println("Hello, World")}

Groovy:

println "Hello World"

Hack:

Haskell:

module Main wheremain = putStrLn "Hello, World!"

Islisp:

(format (standard-output) "Hello, world!")

Java:

public class Java {    public static void main(String[] args){        System.out.println("Hello World");    }}

JavaScript:

console.log("Hello World");

Lisp:

; LISP(DEFUN hello ()  (PRINT (LIST 'HELLO 'WORLD)))(hello)

感兴趣的想要查看所有语言的“hello world”程序,就自己到GitHub项目页查看吧,最后奉上GitHub地址:https://github.com/leachim6/hello-world

开源最前线(ID:OpenSourceTop)编译

链接:https://github.com/leachim6/hello-world

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值