相信有很多同学学习编程语言的第一个程序便是输出 “Hello World”吧。 接下来我们来看下使用28种不同语言如何输出 “Hello World”

1.PHP

<?php
    echo("hello world!")
?>

2.C

#include 
 
int main()
{
    printf("Hello, World");
    return(0);
}

3.C++

#include 
 
int main()
{
    std::cout << "Hello World";
    return 0;
}

4.C#

using System;
class Program
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Hello, World");
    }
}

5.Bash

echo "Hello, World"

6.Basic

PRINT "Hello, World"

7.JAVA

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

8.HTML

Hello, World

9.Clipper

? "Hello, World"

10.Delphi

program HelloWorld;
begin
  Writeln('Hello, World');
end.

11.CoffeeScript

console.log 'Hello, World'

12.MatLab

disp('Hello, World')

13.Julia

println("Hello, World")

14.JavaScript

document.write('Hello, World');

15.jQuery

$("body").append("Hello, World");

16.Perl 5

print "Hello, World";

17.Logo

print [Hello, World]

18.Pascal

program HelloWorld;
begin
  WriteLn('Hello, World');
end.

19.Objective-C

#import 
#import 
 
int main(void)
{
    NSLog(@"Hello, World");
    return 0;
}

20.Visual Basic .NET

Module Module1
    Sub Main()
        Console.WriteLine("Hello, World")
    End Sub
End Module

21.R

cat('Hello, World')

22.VBScript

MsgBox "Hello, World"

23.XSLT

Hello, World

24.Processing

void setup(){
  println("Hello, World");
}

25.Ruby

puts "Hello, World"

26.Swift

print("Hello, World")

27.Python

print("Hello, World")

28.Asp

<%
response.write("hello world")
%>