## Hello, World!

View as PDF

Points: 1
Time limit: 1.0s
Memory limit: 64M

Problem type

Welcome to the DMOJ!

In this task, you must print out the message Hello, World! — the judge is very strict, so you must output it with the same capitalization and punctuation.

Some example solutions in a couple of languages are shown below. After you've gotten the hang of submitting, try out a harder problem like A Plus B.

#### Python 2/3

print("Hello, World!")


#### Java

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


#### C++

#include <iostream>

using namespace std;

int main() {
cout << "Hello, World!" << endl;
return 0;
}


#### C

#include <stdio.h>

int main() {
printf("Hello, World!\n");
return 0;
}


#### Pascal

program helloworld;
begin
writeln('Hello, World!');
end.


#### JavaScript

print('Hello, World!');


#### Turing

put "Hello, World!"

main = putStrLn "Hello, World!"


#### Perl

print "Hello, World!"


#### PHP

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


#### C#

using System;

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


#### D

import std.stdio;

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


#### Go

package main

import "fmt"

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


#### Scala

object helloworld extends App {
println("Hello World!")
}


#### Swift

print("Hello, World!")


#### Kotlin

fun main(args: Array<String>) {
print("Hello, World!")
}


#### Racket

#lang racket
(displayln "Hello, World!")


#### Ruby

puts 'Hello, World!'


#### Rust

fn main() {
println!("Hello, World!");
}


#### OCaml

print_string "Hello, World!\n";;


#### NASM x86

section .text
global  _start

_start:
mov     eax,    4
xor     ebx,    ebx
inc     ebx
mov     ecx,    msg
mov     edx,    len
int     80h

xor     eax,    eax
inc     eax
xor     ebx,    ebx
int     80h

section .data
msg     db      "Hello, World!", 0xA
len     equ     \$ - msg


• quentin9909  commented on April 15, 2019, 1:06 p.m.

-[------->+<]>-.-[->+++++<]>++.+++++++..+++.[->+++++<]>+.------------.---[->+++<]>.-[--->+<]>---.+++.------.--------.-[--->+<]>.
• qcminecraft  commented on Aug. 25, 2018, 9:20 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• Raymo111  commented on Aug. 7, 2018, 7:40 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• BULLET999  commented on Dec. 2, 2017, 12:26 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• ZippIE  commented on Dec. 2, 2017, 7:24 p.m.

Have your program output "Hello, World!" to the console.

• quantum  commented on Aug. 23, 2017, 11:00 a.m.

exists for this purpose, and should be used if you want to ask questions or otherwise make comments that are unlikely to benefit other readers. This includes discussing problem spoilers or requests to debug code.

Violation of this may result in your comments being removed. Repeat offenders may be muted.

• Xyene  commented on Feb. 22, 2017, 3:02 p.m. edit 2

This is a reminder that some schools will be writing the CCC until March 1st, and that online discussion should be kept to a minimum until then. This includes polling for scores.

• bobhob314  commented on Feb. 22, 2017, 3:06 p.m.

Sorry Toods. I enjoyed your appearance in the problemset btw.

• root  commented on Sept. 25, 2016, 11:02 p.m. edit 2

After making 30+ attempts over five hours in four different languages, I'm speechless. The performance measurement needs some serious work. I posted the exact same code in the exact same configuration but somehow the performance was off by 100x+.(python 2 "print "Hello, World!"")

• root  commented on Sept. 25, 2016, 10:58 p.m. edit 3

There's me with assembly trying every bit of performance voodoo magic known to man. And then there's that guy with python2 four places above me who simply did "print 'Hello, World!'". Then comes the depressing realization that I literally spent more than two hours on a hello world program...

• moladan123  commented on Sept. 26, 2016, 5:39 p.m.

Look on the bright side. You just made hello world run in only 4 kilobytes.

• moladan123  commented on Jan. 24, 2015, 6:23 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• quantum  commented on Jan. 24, 2015, 6:25 p.m.

The best submissions does this already. Besides, it is trivially doable in some languages, most notably assembly.

• Get_Shrekd_Fedora_Scrublord  commented on Nov. 14, 2014, 2:20 p.m.

This is too challenging for most people. It's unreasonable to think you can keep the memory under 64M. Petition to remove this problem from the Internet.

• Kyddlygon1_9  commented on Nov. 19, 2014, 11:24 a.m.

After carefully rereading the problem's requirements over and over again, I have concluded that you are in fact correct. I will gladly sign such a petition, if only to ease the pain one must suffer staying up long nights trying to complete this unfeasible project. My sentiments out to all families who have fallen victim to this terrible request.

• getwr3cked_scrublord  commented on Nov. 18, 2014, 2:02 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• steePHAN  commented on May 26, 2015, 11:26 a.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• bobhob314  commented on May 26, 2015, 12:40 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• PaulOlteanu  commented on May 27, 2015, 10:44 p.m.

I'm pretty sure you're the one who forced them to create those guidelines.