View Problem

Output a string to the console

Write the string "Hello World!" to STDOUT
DiskEdit
ruby
puts "Hello World!"
DiskEdit
ruby
$stdout<<"Hello World!"
ExpandDiskEdit
java
System.out.println("Hello World!");
ExpandDiskEdit
java 1.5 or later
System.out.printf("Hello World!\n");
DiskEdit
perl
print "Hello World!\n"
DiskEdit
groovy
println "Hello World!"
ExpandDiskEdit
scala
println("Hello World!")
ExpandDiskEdit
scala Java 1.5 or later
printf("Hello World!\n")
DiskEdit
python
print "Hello World!"
DiskEdit
python 3
# python 3 requires parentheses for print

print('Hello, world!\n')
ExpandDiskEdit
cpp
std::cout << "Hello World" << std::endl;
ExpandDiskEdit
cpp
std::printf("Hello World\n");
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Console::WriteLine(L"Hello World");
ExpandDiskEdit
fsharp
printfn "Hello World!"
ExpandDiskEdit
erlang
io:format("Hello, World!~n").
DiskEdit
ocaml
print_string "Hello world!\n";;
DiskEdit
ocaml
print_endline "Hello world!";;
DiskEdit
ocaml
Printf.printf "Hello world!\n";;
ExpandDiskEdit
csharp
System.Console.WriteLine("Hello World!")
ExpandDiskEdit
php
echo 'Hello World!';
ExpandDiskEdit
php
/****
* For some (security)reason I couldn't
* submit this without adding a space to
* the functionname. Please remove it :)
****/

// The correct way in command line-mode. :)
f write(STDOUT, "Hello World!\n");
DiskEdit
haskell
main = putStrLn "Hello World!"
DiskEdit
clojure
(println "Hello World!")
ExpandDiskEdit
fantom
echo("Hello World!")
ExpandDiskEdit
go
fmt.Printf("Hello, world\n")
ExpandDiskEdit
go
fmt.Println("Hello, World!")

Submit a new solution for ruby, java, perl, groovy ...