Hello World!

ASP

<!DOCTYPE html>
<html>
    <body>
        <% response.write("Hello World!") %>
    </body>
</html>

ActionScript/Flash

package {
    import flash.display.MovieClip;
    //引入事件包

    public class HelloWorld extends MovieClip {
        public function HelloWorld() {
            btnHelloWorld.addEventListener(MouseEvent.CLICK, onClick);
        }

        private function onClick(me:MouseEvent):void {
            trace("Hello World!");
        }
    }
}

Linux Shell

#!bin/sh
echo "hello world!"

C语言

#include <stdio.h>
int main()
{
   // printf() 中字符串需要引号
   printf("Hello, World!");
   return 0;
}

C++

#include <iostream>
using namespace std;

int main(int argc, char * argv[])
{
    cout << "Hello, World!" << endl;
}

C

using System;
namespace HelloWorld
{
    class Hello
    {
        static void Main()
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}

D语言

import std.stdio;

void main()
{
    writeln("Hello ", "World!");
}

Dart

class HelloDartTest {
  static testMain() {
    print("Hello, World!");
  }
}

main() {
  HelloDartTest.testMain();
}

Delphi

procedure TForm1.Button1Click(Sender: TObject);
begin
    Edit1.Text := 'Hello World!';
end;

end.

Erlang

-module(helloworld).
-export([hw/0]).

hw() -> io:format("Hello World! ~n").

Go语言

package main
import  "fmt"
func main() {
    fmt.Println("Hello World!")
}

Groovy

 println 'Hello World'

Java

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

JavaScript

console.log('Hello World!');

Lua

function printHello(printString)
    print(printString)
end

printHello("Hello World!")

Objective-C

#import <stdio.h>

int main(int argc,const char *argv[]){
    printf("Hello World\n");
    //return 0;
}

PHP

<?php
    echo 'Hello,World!';
?>

Perl

#!/usr/bin/perl

print "Hello World!/n";

Python

print('Hello World!')

R语言

#! /usr/bin/env Rscript

print ("Hello World!");

Ruby

puts "Hello World!"

SQL

declare
  message varchar2(20):='hello,Wrold!';
begin
  dbms_output.put_line(message);
end;

Scala

object HelloWorld{
    def main(args : Array[String]){
        println("HelloWorld")
    }
}

Swift

@IBOutlet weak varr label: UILabel!
@IBAction func onclick(sender: AnyObject) {
    label.text = "Hello World!"
}

VB

Private Sub Form_Click()

MsgBox ("hello world")

End Sub

……

语言很多,他们都很友好,于是没有好坏高低之分,所以希望你从今天起,不要只停留在“Hello World!”

向前!向前!向前!

发表评论

电子邮件地址不会被公开。