Hello, world!: 두 판 사이의 차이

Gaon12 (토론 / 기여)
시작
 
Gaon12 (토론 / 기여)
JavaScript: console.log 추가
 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
26번째 줄: 26번째 줄:


==각 언어로 표현한 Hello, world!==
==각 언어로 표현한 Hello, world!==
=== Ada ===
<syntaxhighlight lang='bash'>
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello_World is
begin
  Put_Line("Hello, world!");
end Hello_World;
</syntaxhighlight>
=== ActionScript ===
<syntaxhighlight lang='actionscript'>
package {
    import flash.display.Sprite;
    public class HelloWorld extends Sprite {
        public function HelloWorld() {
            trace("Hello, world!");
        }
    }
}
</syntaxhighlight>
=== Agda ===
<syntaxhighlight lang='agda'>
open import IO
main = run (putStr "Hello, World!")
</syntaxhighlight>
===Bash===
<syntaxhighlight lang='bash'>
#!/bin/bash
echo "Hello, world!"
printf "Hello, world!"
</syntaxhighlight>
=== Assembly ===
<syntaxhighlight>
section .data
    hello:    db 'Hello, World!', 0Ah  ; 'Hello, World!' plus a linefeed character
    helloLen:  equ $-hello              ; Length of the 'Hello, World!' string
section .bss
section .text
    global _start
_start:
    mov    edx, helloLen              ; Set the length of the string to be written
    mov    ecx, hello                  ; Set the address of the string to be written
    mov    ebx, 1                      ; Set the file descriptor to stdout (1)
    mov    eax, 4                      ; System call number (sys_write)
    int    80h                        ; Call the kernel
    mov    eax, 1                      ; System call number (sys_exit)
    xor    ebx, ebx                    ; Exit with return code 0 (no error)
    int    80h                        ; Call the kernel
</syntaxhighlight>
=== AutoIT ===
<syntaxhighlight lang='autoit'>
MsgBox(0, "Message", "Hello, world!")
</syntaxhighlight>
=== Batch ===
<syntaxhighlight lang='batch'>
@echo off
echo Hello, world!
</syntaxhighlight>
=== BrainFuck ===
<syntaxhighlight lang='brainfuck'>
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++++++++++++++.------------.<<+++++++++++++++.>.+++.------.--------.>+.
</syntaxhighlight>
===C===
===C===
<syntaxhighlight lang='C'>
<syntaxhighlight lang='C'>
43번째 줄: 121번째 줄:


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


     return 0;
     return 0;
}
</syntaxhighlight>
===C#===
<syntaxhighlight lang='c#'>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hello_World
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
        }
    }
}
</syntaxhighlight>
=== CSS ===
<syntaxhighlight lang='css'>
content: "Hello, world!";
</syntaxhighlight>
=== D ===
<syntaxhighlight lang='d'>
import std.stdio;
void main()
{
    writeln("Hello, world!");
}
</syntaxhighlight>
===Dart===
<syntaxhighlight lang='dart'>
void main(){
print("Hello, world!");
}
</syntaxhighlight>
===Fortran===
<syntaxhighlight lang='fortran'>
program Helloworld
print *,"Hello, world!"
end program
</syntaxhighlight>
===HTML===
<syntaxhighlight lang='html'>
<!DOCTYPE HTML>
<html>
<head>
<title>Hello!</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
</syntaxhighlight>
===Java===
<syntaxhighlight lang='java'>
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}
}
</syntaxhighlight>
</syntaxhighlight>
51번째 줄: 200번째 줄:
===JavaScript===
===JavaScript===
<syntaxhighlight lang='javascript'>
<syntaxhighlight lang='javascript'>
document.write("Hello, world!")
document.write("Hello, world!");
console.log("Hello, world!");
</syntaxhighlight>
 
===Kotlin===
<syntaxhighlight lang='kotlin'>
fun main() {
    println("Hello, world!")
}
</syntaxhighlight>
</syntaxhighlight>


===Python===
=== 몰랭(Mollang) ===
<syntaxhighlight lang='python'>
<syntaxhighlight>
print('Hello, world!')
몰????.??????????? 모올????.????.?? 모오올몰모올
아모오올!!!!루 모오올모올 아모오올!!!!!!!루 아모오올루 아모오올루
아모오올???루 아몰루 아모올루 몰모올 아몰???????????????????????????????????????????루 아모오올???루
아몰모올??????루 아모오올루 아모오올!!!!!!!!루 아모올?루
</syntaxhighlight>
 
=== Pascal ===
<syntaxhighlight lang='pascal'>
begin
write('Hello, world!');
end.
</syntaxhighlight>
</syntaxhighlight>


62번째 줄: 229번째 줄:
<syntaxhighlight lang='PHP'>
<syntaxhighlight lang='PHP'>
<?php
<?php
echo "Hello, world";
echo "Hello, world!";
?>
?>
</syntaxhighlight>
=== PowerShell(ps1) ===
<syntaxhighlight lang='ps1'>
Write-Output "Hello, world!"
</syntaxhighlight>
===Python===
<syntaxhighlight lang='python'>
print('Hello, world!')
</syntaxhighlight>
=== SQL ===
<syntaxhighlight lang='sql'>
SELECT 'Hello, world!' AS greeting;
</syntaxhighlight>
===Ruby===
<syntaxhighlight lang='ruby'>
puts "Hello, world!"
print "Hello, world!"
</syntaxhighlight>
=== Verilog ===
<syntaxhighlight lang='verilog'>
module main;
  initial begin
      $display("Hello, world!");
      $finish;
    end
endmodule
</syntaxhighlight>
=== VHDL ===
<syntaxhighlight lang='vhdl'>
use std.textio.all;
entity main is
end main;
architecture behaviour of main is
begin
    process
        variable hello : line;
    begin
        write (hello, String'("Hello, world!"));
        writeline (output, hello);
        wait;
    end process;
end behaviour;
</syntaxhighlight>
=== 엄랭 ===
<syntaxhighlight>
어떻게
어엄
어어엄
어어어엄
어어어어엄
어어어어어엄
어어어어어어엄
어어어어어어어엄
엄어..........
동탄어?준..... .....
어엄어어.......
어어엄어어어..........
어어어엄어어어어...
어어어어엄어어어어어.
엄어,
준.............
어엄어어..
식어어ㅋ
어어엄어어어.
식어어어ㅋ
어어엄어어어.......
식어어어ㅋ
식어어어ㅋ
어어엄어어어...
식어어어ㅋ
어어어엄어어어어..............
식어어어어ㅋ
어어어엄어어어어,,,,,,,,,,,,
식어어어어ㅋ
어엄어어...............
식어어ㅋ
식어어어ㅋ
어어엄어어어...
식어어어ㅋ
어어엄어어어,,,,,,
식어어어ㅋ
어어엄어어어,,,,,,,,
식어어어ㅋ
어어어엄어어어어.
식어어어어ㅋ
화이팅!.,
이 사람이름이냐ㅋㅋ
</syntaxhighlight>
</syntaxhighlight>


==분기==
==분기==
{{분기|도움말:위키 문법/SyntaxHighlight|85572||가온 위키}}
{{분기|도움말:위키 문법/SyntaxHighlight|85572||가온 위키}}

2024년 8월 9일 (금) 21:04 기준 최신판

#include <stdio.h>

int main()
{
	printf("Hello, world!");

	return 0;
}
#include <stdio.h>

int main()
{
	printf("안녕 세상아!");

	return 0;
}

컴퓨터 언어들에서 가장 기본으로 배우는 내용인 Hello, world!에 대해 다룬다. 거의 모든 프로그래밍 책들은 국룰로 처음에 Hello, world!로 시작하며, 이는 데니스 리치가 쓴 책인 "The C Programming Language" 교재의 첫 번째 예제가 화면이 "Hello, world!"를 출력하는 것이었기 때문이었다.


각 언어로 표현한 Hello, world![편집 / 원본 편집]

Ada[편집 / 원본 편집]

with Ada.Text_IO; use Ada.Text_IO;

procedure Hello_World is
begin
   Put_Line("Hello, world!");
end Hello_World;

ActionScript[편집 / 원본 편집]

package {
    import flash.display.Sprite;

    public class HelloWorld extends Sprite {
        public function HelloWorld() {
            trace("Hello, world!");
        }
    }
}

Agda[편집 / 원본 편집]

open import IO

main = run (putStr "Hello, World!")

Bash[편집 / 원본 편집]

#!/bin/bash

echo "Hello, world!"
printf "Hello, world!"

Assembly[편집 / 원본 편집]

section .data
    hello:     db 'Hello, World!', 0Ah  ; 'Hello, World!' plus a linefeed character
    helloLen:  equ $-hello              ; Length of the 'Hello, World!' string

section .bss

section .text
    global _start

_start:
    mov     edx, helloLen               ; Set the length of the string to be written
    mov     ecx, hello                  ; Set the address of the string to be written
    mov     ebx, 1                      ; Set the file descriptor to stdout (1)
    mov     eax, 4                      ; System call number (sys_write)
    int     80h                         ; Call the kernel

    mov     eax, 1                      ; System call number (sys_exit)
    xor     ebx, ebx                    ; Exit with return code 0 (no error)
    int     80h                         ; Call the kernel

AutoIT[편집 / 원본 편집]

MsgBox(0, "Message", "Hello, world!")

Batch[편집 / 원본 편집]

@echo off
echo Hello, world!

BrainFuck[편집 / 원본 편집]

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++++++++++++++.<hr>.<<+++++++++++++++.>.+++.<hr>.<hr>.>+.

C[편집 / 원본 편집]

#include <stdio.h>

int main()
{
	printf("Hello, world!");

	return 0;
}

C++[편집 / 원본 편집]

#include <iostream>

int main(int argc, char* argv[]) {
    std::cout << "Hello, world!" << std::endl;

    return 0;
}

C#[편집 / 원본 편집]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Hello_World
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, world!");
        }
    }
}

CSS[편집 / 원본 편집]

content: "Hello, world!";

D[편집 / 원본 편집]

import std.stdio;

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

Dart[편집 / 원본 편집]

void main(){
 print("Hello, world!");
}

Fortran[편집 / 원본 편집]

program Helloworld
print *,"Hello, world!"
end program

HTML[편집 / 원본 편집]

<!DOCTYPE HTML>
<html>
	<head>
		<title>Hello!</title>
	</head>
	<body>
		<p>Hello, world!</p>
	</body>
</html>

Java[편집 / 원본 편집]

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

JavaScript[편집 / 원본 편집]

document.write("Hello, world!");
console.log("Hello, world!");

Kotlin[편집 / 원본 편집]

fun main() {
    println("Hello, world!")
}

몰랭(Mollang)[편집 / 원본 편집]

몰????.??????????? 모올????.????.?? 모오올몰모올
아모오올!!!!루 모오올모올 아모오올!!!!!!!루 아모오올루 아모오올루
아모오올???루 아몰루 아모올루 몰모올 아몰???????????????????????????????????????????루 아모오올???루
아몰모올??????루 아모오올루 아모오올!!!!!!!!루 아모올?루

Pascal[편집 / 원본 편집]

begin
	write('Hello, world!');
end.

PHP[편집 / 원본 편집]

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

PowerShell(ps1)[편집 / 원본 편집]

Write-Output "Hello, world!"

Python[편집 / 원본 편집]

print('Hello, world!')

SQL[편집 / 원본 편집]

SELECT 'Hello, world!' AS greeting;

Ruby[편집 / 원본 편집]

puts "Hello, world!"
print "Hello, world!"

Verilog[편집 / 원본 편집]

module main;
  initial begin
      $display("Hello, world!");
      $finish;
    end
endmodule

VHDL[편집 / 원본 편집]

use std.textio.all;

entity main is
end main;

architecture behaviour of main is
begin
    process
        variable hello : line;
    begin
        write (hello, String'("Hello, world!"));
        writeline (output, hello);
        wait;
    end process;
end behaviour;

엄랭[편집 / 원본 편집]

어떻게

엄
어엄
어어엄
어어어엄
어어어어엄
어어어어어엄
어어어어어어엄
어어어어어어어엄

엄어..........
동탄어?준..... .....

어엄어어.......

어어엄어어어..........

어어어엄어어어어...

어어어어엄어어어어어.

엄어,
준.............

어엄어어..
식어어ㅋ

어어엄어어어.
식어어어ㅋ
어어엄어어어.......
식어어어ㅋ
식어어어ㅋ
어어엄어어어...
식어어어ㅋ

어어어엄어어어어..............
식어어어어ㅋ
어어어엄어어어어<sub></sub><sub></sub><sub></sub>
식어어어어ㅋ

어엄어어...............
식어어ㅋ

식어어어ㅋ
어어엄어어어...
식어어어ㅋ
어어엄어어어<sub></sub><sub>
식어어어ㅋ
어어엄어어어</sub><sub></sub>,,
식어어어ㅋ

어어어엄어어어어.
식어어어어ㅋ

화이팅!.,

이 사람이름이냐ㅋㅋ

분기[편집 / 원본 편집]

이 문서는 가온 위키도움말:위키 문법/SyntaxHighlight 문서 85572판에서 분기하였습니다.