学习编程语言的第一个程序一般是输出 "Hello World"。 接下来我们来看下26 种不同语言如何输出 "Hello World":
#include
int main()
{
printf("Hello, World");
return(0);
}
#include
int main()
{
std::cout << "Hello World";
return 0;
}
using System;
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello, World");
}
}
echo "Hello, World"
PRINT "Hello, World"
Hello, World
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
? "Hello, World"
program HelloWorld;
begin
Writeln('Hello, World');
end.
console.log 'Hello, World'
disp('Hello, World')
println("Hello, World")
document.write('Hello, World');
print [Hello, World]
$("body").append("Hello, World");
print "Hello, World";
program HelloWorld;
begin
WriteLn('Hello, World');
end.
#import
#import
int main(void)
{
NSLog(@"Hello, World");
return 0;
}
Module Module1
Sub Main()
Console.WriteLine("Hello, World")
End Sub
End Module
cat('Hello, World')
MsgBox "Hello, World"
Hello, World
void setup(){
println("Hello, World");
}
puts "Hello, World"
print("Hello, World")
print ("Hello, World")