今天是2024年7月7日 第27周 星期日

代人,时大变了。

我们生活在大地上,但我们的梦想超越天空。

「Hello world」修訂間的差異

出自Akarin
跳至導覽 跳至搜尋
 
(未顯示由 3 位使用者於中間所作的 5 次修訂)
行 1: 行 1:
 
'''Hello world'''为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门编程语言的第一个程序。
 
'''Hello world'''为一梗,于程序员中流传,源于《Introduction to the Language B》一书示例程序之首,后用于入门编程语言的第一个程序。
 +
 +
==各类代码实现==
 +
 +
===ABAP===
 +
<source lang="abap">
 +
REPORT Z_AKARIN_HELLO.
 +
WRITE 'Hello world!'.
 +
</source>
 +
===C===
 +
<source lang="c">
 +
#include<stdio.h>
 +
int main(){
 +
   printf("Hello world!");
 +
}
 +
</source>
 +
===C++===
 +
<source lang="cpp">
 +
#include<iostream>
 +
int main(){
 +
   std::cout<<"Hello world!";
 +
}
 +
</source>
 +
===Python===
 +
<source lang="py">
 +
print("Hello world!")
 +
</source>
 +
<source lang="py">
 +
import __hello__
 +
</source>
 +
===Lua===
 +
{{Seealso|Module:Example}}
 +
===Wenyan===
 +
<source>
 +
吾有一言。曰「「問天地好在。」」。書之。
 +
</source>

於 2020年7月19日 (日) 13:26 的最新修訂

Hello world為一梗,於程式設計師中流傳,源於《Introduction to the Language B》一書示例程序之首,後用於入門程式語言的第一個程序。

各類代碼實現

ABAP

<source lang="abap"> REPORT Z_AKARIN_HELLO. WRITE 'Hello world!'. </source>

C

<source lang="c">

  1. include<stdio.h>

int main(){

   printf("Hello world!");

} </source>

C++

<source lang="cpp">

  1. include<iostream>

int main(){

   std::cout<<"Hello world!";

} </source>

Python

<source lang="py"> print("Hello world!") </source> <source lang="py"> import __hello__ </source>

Lua

Wenyan

<source> 吾有一言。曰「「問天地好在。」」。書之。 </source>