Output the string
Hello, world!
in the terminal window.
|
Output the UTF-8 string
안녕하세요?
in the terminal window.
|
C Hello
#include
int main()
{
printf("Hello, world!\n");
return 0;
}
|
C 한글 Hello
#include
int main()
{
printf("안녕하세요?\n");
return 0;
}
|
C++ Hello
#include
using namespace std;
int main( void )
{
cout << "Hello, world!" << endl;
return 0;
}
|
C++ 한글 Hello
#include
int main( void )
{
setlocale(LC_ALL,"");
std::wcout << L"안녕하세요?" << std::endl;
return 0;
}
|
C++/CLI Hello
// Compile with options: /clr /utf-8 /std:c++17
#include
#include
int main(cli::array ^args)
{
System::Console::WriteLine("Managed Hello World");
std::cout << "Native Hello World" << std::endl;
printf("Traditional C Hello World\n");
return 0;
}
|
C++/CLI 한글 Hello
// Compile width options: /clr /utf-8 /std:c++17
#include
#include
int main(cli::array ^args)
{
System::Console::WriteLine("Managed 안녕하세요?");
setlocale(LC_ALL,"");
std::wcout << L"Native 안녕하세요?" << std::endl;
wprintf(L"Traditional C 안녕하세요?\n");
return 0;
}
|
C# Hello
using System;
namespace GeneralHelloApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, world!");
}
}
}
|
C# 한글 Hello
using System;
namespace GeneralHelloApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("안녕하세요?");
}
}
}
|
F# Hello
printfn "Hello, world!"
|
F# 한글 Hello
printfn "안녕하세요?"
|
Java Hello
public class Hello {
public staic void main(String[] args) {
System.out.println("Hello, world!");
}
}
|
Java 한글 Hello
public class Hello {
public staic void main(String[] args) {
System.out.println("안녕하세요?");
}
}
|
Python3 Hello
print("Hello, world!")
|
Python3 한글 Hello
print("안녕하세요?")
|
Python2 Hello
print "Hello, world!"
|
Python2 한글 Hello
print "안녕하세요?"
|
Ruby Hello
print "Hello, world!\n"
|
Ruby 한글 Hello
print "안녕하세요?\n"
|
PHP Hello
echo "Hello, world!" . PHP_EOL;
|
PHP 한글 Hello
echo "안녕하세요?" . PHP_EOL;
|
Lua Hello
print("Hello, world!")
|
Lua 한글 Hello
print("안녕하세요?")
|
Groovy Hello
println("Hello, world!")
|
Groovy 한글 Hello
println("안녕하세요?")
|